Use registry token secret for image push
This commit is contained in:
@@ -61,14 +61,14 @@ jobs:
|
|||||||
- name: Login to registry
|
- name: Login to registry
|
||||||
env:
|
env:
|
||||||
REGISTRY_USERNAME: ${{ secrets.REGISTRY_USERNAME }}
|
REGISTRY_USERNAME: ${{ secrets.REGISTRY_USERNAME }}
|
||||||
REGISTRY_PASSWORD: ${{ secrets.REGISTRY_PASSWORD }}
|
REGISTRY_TOKEN: ${{ secrets.REGISTRY_TOKEN }}
|
||||||
run: |
|
run: |
|
||||||
set -eu
|
set -eu
|
||||||
if [ -z "${REGISTRY_USERNAME:-}" ] || [ -z "${REGISTRY_PASSWORD:-}" ]; then
|
if [ -z "${REGISTRY_USERNAME:-}" ] || [ -z "${REGISTRY_TOKEN:-}" ]; then
|
||||||
echo "REGISTRY_USERNAME and REGISTRY_PASSWORD secrets are required."
|
echo "REGISTRY_USERNAME and REGISTRY_TOKEN secrets are required."
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
printf '%s' "$REGISTRY_PASSWORD" | docker login "$REGISTRY_URL" --username "$REGISTRY_USERNAME" --password-stdin
|
printf '%s' "$REGISTRY_TOKEN" | docker login "$REGISTRY_URL" --username "$REGISTRY_USERNAME" --password-stdin
|
||||||
|
|
||||||
- name: Build Docker image
|
- name: Build Docker image
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ The workflow at `.gitea/workflows/ci-cd.yml` expects these repository secrets:
|
|||||||
```sh
|
```sh
|
||||||
REGISTRY_URL=gitea.blyzer.com.br
|
REGISTRY_URL=gitea.blyzer.com.br
|
||||||
REGISTRY_USERNAME=...
|
REGISTRY_USERNAME=...
|
||||||
REGISTRY_PASSWORD=...
|
REGISTRY_TOKEN=...
|
||||||
IMAGE_REPOSITORY=blyzer/production-order-tiny
|
IMAGE_REPOSITORY=blyzer/production-order-tiny
|
||||||
PORTAINER_WEBHOOK_URL=https://... # optional but recommended
|
PORTAINER_WEBHOOK_URL=https://... # optional but recommended
|
||||||
```
|
```
|
||||||
|
|||||||
Reference in New Issue
Block a user