Merge pull request #66 from varun-raj/feat-nov-release #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: ci | |
| on: | |
| push: | |
| branches: | |
| - release | |
| jobs: | |
| release: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| outputs: | |
| new-release-published: ${{ steps.release.outputs.new-release-published }} | |
| new-release-version: ${{ steps.release.outputs.new-release-version }} | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - uses: actions/setup-node@v3 | |
| with: | |
| node-version: 20 | |
| - name: Run semantic-release | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| id: release | |
| run: | | |
| npm install | |
| npx semantic-release | |
| build: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| packages: write | |
| needs: release | |
| if: needs.release.outputs.new-release-published == 'true' | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - uses: docker/setup-buildx-action@v3 | |
| - uses: docker/login-action@v3 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Build and push Docker image | |
| run: | | |
| echo VERSION=${{ needs.release.outputs.new-release-version }} >> .env | |
| docker build -t ghcr.io/${{ github.repository }}:${{ needs.release.outputs.new-release-version }} \ | |
| -t ghcr.io/${{ github.repository }}:latest . | |
| docker push ghcr.io/${{ github.repository }}:latest | |
| docker push ghcr.io/${{ github.repository }}:${{ needs.release.outputs.new-release-version }} |