diff --git a/.actrc b/.actrc new file mode 100644 index 0000000..6eb74fe --- /dev/null +++ b/.actrc @@ -0,0 +1,2 @@ +-P ubuntu-latest=catthehacker/ubuntu:act-latest +--artifact-server-path=/tmp/act-artifacts diff --git a/.gitea/workflows/build-and-deploy.yml b/.gitea/workflows/build-and-deploy.yml index 1726364..68b2dd3 100644 --- a/.gitea/workflows/build-and-deploy.yml +++ b/.gitea/workflows/build-and-deploy.yml @@ -42,12 +42,23 @@ jobs: echo "full=${REGISTRY_HOST}/${REPO}:${TAG}" >> "$GITHUB_OUTPUT" echo "latest=${REGISTRY_HOST}/${REPO}:latest" >> "$GITHUB_OUTPUT" + - name: Check Docker registry credentials + id: registry-check + run: | + if [ -n "${{ secrets.GITEA_TOKEN }}" ]; then + echo "available=true" >> "$GITHUB_OUTPUT" + else + echo "available=false" >> "$GITHUB_OUTPUT" + fi + - name: Install Docker CLI + if: steps.registry-check.outputs.available == 'true' run: | apt-get update -qq apt-get install -y -qq docker.io - name: Log in to Gitea Container Registry + if: steps.registry-check.outputs.available == 'true' run: | echo "${{ secrets.GITEA_TOKEN }}" | \ docker login "$REGISTRY_HOST" \ @@ -59,7 +70,7 @@ jobs: with: context: . file: ${{ env.DOCKERFILE_PATH }} - push: true + push: ${{ steps.registry-check.outputs.available == 'true' }} tags: | ${{ steps.image-meta.outputs.full }} ${{ steps.image-meta.outputs.latest }}