diff --git a/.gitea/workflows/build.yaml b/.gitea/workflows/build.yaml index ad893c0..24ece9a 100644 --- a/.gitea/workflows/build.yaml +++ b/.gitea/workflows/build.yaml @@ -15,6 +15,9 @@ on: env: REGISTRY: ${{ vars.REGISTRY || 'davejansen.dev' }} + REGISTRY_USERNAME: ${{ github.actor }} + IMAGE_TAG: ${{ vars.IMAGE_TAG || 'latest' }} + IMAGE_NAME: ${{ github.event.repository.name }} concurrency: group: ${{ github.workflow }}-${{ github.ref || github.run_id }}-${{ @@ -35,7 +38,7 @@ jobs: - name: Prepare environment run: | # Lowercase the image uri - echo "IMAGE_REGISTRY=${IMAGE_REGISTRY,,}" >> ${GITHUB_ENV} + echo "REGISTRY=${REGISTRY,,}" >> ${GITHUB_ENV} echo "IMAGE_NAME=${IMAGE_NAME,,}" >> ${GITHUB_ENV} - name: Checkout @@ -57,7 +60,7 @@ jobs: uses: docker/login-action@v3 with: registry: ${{ env.REGISTRY }} - username: ${{ github.actor }} + username: ${{ env.REGISTRY_USERNAME }} password: ${{ secrets.REGISTRY_TOKEN }} - name: Build and push image @@ -65,7 +68,7 @@ jobs: uses: docker/build-push-action@v6 with: push: true - tags: davejansen/caddy-bunny:latest + tags: ${{ env.REGISTRY }}/${{ env.REGISTRY_USERNAME }}/${{ env.IMAGE_NAME }}:${{ env.IMAGE_TAG }} # # # This section is optional and only needs to be enabled if you plan on distributing