update todo #3
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, Push Docker image, and Create Release | |
| on: | |
| push: | |
| tags: | |
| - 'v*' # Only runs on version tags | |
| permissions: | |
| contents: write # Required for creating releases | |
| packages: write | |
| jobs: | |
| build-push-release: | |
| runs-on: ubuntu-latest | |
| 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 and image name | |
| id: meta | |
| run: | | |
| IMAGE_NAME=ghcr.io/${{ github.repository }} | |
| TAG=${GITHUB_REF#refs/tags/} | |
| echo "image_name=${IMAGE_NAME,,}" >> $GITHUB_OUTPUT | |
| echo "tag=${TAG}" >> $GITHUB_OUTPUT | |
| - name: Build Docker image with version and latest tags | |
| run: | | |
| docker build -t ${{ steps.meta.outputs.image_name }}:${{ steps.meta.outputs.tag }} \ | |
| -t ${{ steps.meta.outputs.image_name }}:latest . | |
| - name: Push both tags | |
| run: | | |
| docker push ${{ steps.meta.outputs.image_name }}:${{ steps.meta.outputs.tag }} | |
| docker push ${{ steps.meta.outputs.image_name }}:latest | |
| - name: Create GitHub Release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| tag_name: ${{ steps.meta.outputs.tag }} | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |