name: Build and Deploy run-name: ${{ gitea.actor }} is building ${{ gitea.repository }} ${{ gitea.ref_name }} # Builds a release image for every new version tag (v1.2.3), regardless of # which files changed. Pushes to main no longer trigger a build. on: push: tags: - 'v*' jobs: build: runs-on: ubuntu-latest env: REGISTRY: git.gooienmeer.nl IMAGE: git.gooienmeer.nl/nh_gooi/nhgooi.nl # The tag that triggered this build, e.g. v3.0.2 VERSION: ${{ gitea.ref_name }} steps: - name: Checkout uses: actions/checkout@v4 - name: Login to Gitea Container Registry run: | echo "${{ secrets.REGISTRY_TOKEN }}" | \ docker login "$REGISTRY" \ -u "${{ gitea.actor }}" \ --password-stdin - name: Build image run: | docker build \ -t "$IMAGE:$VERSION" \ -t "$IMAGE:${{ gitea.sha }}" \ -t "$IMAGE:latest" \ . - name: Push image run: | docker push "$IMAGE:$VERSION" docker push "$IMAGE:${{ gitea.sha }}" docker push "$IMAGE:latest" # - name: Trigger deployment # run: | # curl --fail-with-body \ # -X POST \ # -H "Content-Type: application/json" \ # -d '{ # "image": "'"$IMAGE:${{ gitea.sha }}"'", # "commit": "${{ gitea.sha }}", # "repository": "${{ gitea.repository }}" # }' \ # "${{ secrets.DEPLOY_WEBHOOK_URL }}"