name: Release Pipeline on: release: types: [created] push: branches: [ main ] env: IMAGE_NAME: wygiwyh jobs: build-and-push: runs-on: ubuntu-latest permissions: contents: read steps: - name: Checkout code uses: actions/checkout@v4 - name: Log in to Docker Hub uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1 with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} - name: Set up QEMU uses: docker/setup-qemu-action@v3 - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 - name: Build and push nightly image if: github.event_name == 'push' uses: docker/build-push-action@v6 with: context: . file: ./docker/prod/django/Dockerfile push: true provenance: false tags: ${{ secrets.DOCKERHUB_USERNAME }}/${{ env.IMAGE_NAME }}:nightly platforms: linux/amd64,linux/arm64 cache-from: type=gha cache-to: type=gha,mode=max - name: Build and push release image if: github.event_name == 'release' uses: docker/build-push-action@v6 with: context: . file: ./docker/prod/django/Dockerfile push: true provenance: false tags: | ${{ secrets.DOCKERHUB_USERNAME }}/${{ env.IMAGE_NAME }}:latest ${{ secrets.DOCKERHUB_USERNAME }}/${{ env.IMAGE_NAME }}:${{ github.event.release.tag_name }} platforms: linux/amd64,linux/arm64 cache-from: type=gha cache-to: type=gha,mode=max