Merge pull request #36 from pk9r/dev #24
Workflow file for this run
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 Docker Image on Release Tag | |
| on: | |
| push: | |
| tags: | |
| - 'release*' | |
| jobs: | |
| build-and-push: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| packages: write | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Log in to GitHub Container Registry | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Extract tag name | |
| id: extract_tag | |
| run: echo "TAG=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV | |
| - name: Build Docker image with both tags | |
| run: | | |
| docker build \ | |
| -f src/GitcgNetCord.MainApp/Dockerfile \ | |
| -t ghcr.io/${{ github.repository }}:${{ env.TAG }} \ | |
| -t ghcr.io/${{ github.repository }}:latest \ | |
| . | |
| - name: Push Docker image (version tag) | |
| run: docker push ghcr.io/${{ github.repository }}:${{ env.TAG }} | |
| - name: Push Docker image (latest tag) | |
| run: docker push ghcr.io/${{ github.repository }}:latest |