Build and Push Platform Notification Executor #2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Build and Push Platform Notification Executor | |
| on: | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| packages: write | |
| jobs: | |
| deploy: | |
| name: "Build and Push" | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 | |
| - name: Set timestamp tag | |
| id: set-tag | |
| run: | | |
| echo "tag=ts-$(date -u +%Y%m%d-%H%M%S)" >> "$GITHUB_OUTPUT" | |
| - name: Log in to GHCR | |
| run: echo "${{ github.token }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin | |
| - name: Build Docker image | |
| run: | | |
| docker build \ | |
| -t ghcr.io/${{ github.repository_owner }}/platform-notification-executor:${{ steps.set-tag.outputs.tag }} \ | |
| -t ghcr.io/${{ github.repository_owner }}/platform-notification-executor:latest \ | |
| . | |
| - name: Push Docker image to GHCR | |
| run: | | |
| docker push ghcr.io/${{ github.repository_owner }}/platform-notification-executor:${{ steps.set-tag.outputs.tag }} | |
| docker push ghcr.io/${{ github.repository_owner }}/platform-notification-executor:latest | |
| - name: Remove local Docker image | |
| run: | | |
| docker rmi ghcr.io/${{ github.repository_owner }}/platform-notification-executor:${{ steps.set-tag.outputs.tag }} || true | |
| docker rmi ghcr.io/${{ github.repository_owner }}/platform-notification-executor:latest || true | |
| docker image prune -f |