Merge pull request #13 from varun-raj/feat-smart-merge #18
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: Docker Release | |
| on: | |
| push: | |
| tags: | |
| - "v*" | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| packages: write | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: 'Login to GitHub Container Registry' | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ghcr.io | |
| username: ${{github.actor}} | |
| password: ${{secrets.GITHUB_TOKEN}} | |
| - name: Extract version from package.json | |
| id: extract_version | |
| run: | | |
| VERSION=$(jq -r '.version' package.json) | |
| echo "Version extracted: $VERSION" | |
| echo "VERSION=$VERSION" >> $GITHUB_ENV | |
| - name: Build and push Docker image | |
| run: | | |
| docker build --build-arg VERSION=${{ env.VERSION }} \ | |
| -t ghcr.io/${{ github.repository }}:${{ env.VERSION }} \ | |
| -t ghcr.io/${{ github.repository }}:latest . | |
| docker push ghcr.io/${{ github.repository }}:latest | |
| docker push ghcr.io/${{ github.repository }}:${{ env.VERSION }} |