Use Gitea job token for registry login
Some checks failed
Build & Push Docker Image to Gitea Registry / build-and-push (push) Failing after 7s
Some checks failed
Build & Push Docker Image to Gitea Registry / build-and-push (push) Failing after 7s
This commit is contained in:
@@ -11,6 +11,9 @@ env:
|
|||||||
jobs:
|
jobs:
|
||||||
build-and-push:
|
build-and-push:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
packages: write
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
@@ -43,13 +46,7 @@ jobs:
|
|||||||
- name: Log in to Gitea Package Registry
|
- name: Log in to Gitea Package Registry
|
||||||
shell: sh
|
shell: sh
|
||||||
run: |
|
run: |
|
||||||
if [ -z "${{ secrets.REGISTRY_USER }}" ] || [ -z "${{ secrets.REGISTRY_TOKEN }}" ]; then
|
echo "${{ gitea.token }}" | docker login "${{ env.REGISTRY }}" -u "${{ gitea.actor }}" --password-stdin
|
||||||
echo "Missing registry credentials."
|
|
||||||
echo "Create repository secrets REGISTRY_USER and REGISTRY_TOKEN."
|
|
||||||
echo "REGISTRY_TOKEN must be a Gitea access token with package write permission."
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
echo "${{ secrets.REGISTRY_TOKEN }}" | docker login "${{ env.REGISTRY }}" -u "${{ secrets.REGISTRY_USER }}" --password-stdin
|
|
||||||
|
|
||||||
- name: Build and push Docker image
|
- name: Build and push Docker image
|
||||||
shell: sh
|
shell: sh
|
||||||
|
|||||||
Reference in New Issue
Block a user