diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 116bcd6..6fd1fbe 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -55,12 +55,22 @@ jobs: username: ${{ gitea.actor }} password: ${{ secrets.GIT_TOKEN }} + - name: Get image metadata + id: meta + run: | + NAME=$(node -p "require('./package.json').name.toLowerCase()") + OWNER=$(echo "${{ gitea.actor }}" | tr '[:upper:]' '[:lower:]') + echo "name=${NAME}" >> $GITHUB_OUTPUT + echo "owner=${OWNER}" >> $GITHUB_OUTPUT + - name: Build and push image uses: docker/build-push-action@v5 with: context: . file: Dockerfile push: true - tags: ${{ env.REGISTRY }}/${{ gitea.repository }}:latest + tags: | + ${{ env.REGISTRY }}/${{ steps.meta.outputs.owner }}/${{ steps.meta.outputs.name }}:latest + ${{ env.REGISTRY }}/${{ steps.meta.outputs.owner }}/${{ steps.meta.outputs.name }}:${{ github.sha }} cache-from: type=gha cache-to: type=gha,mode=max