Bump js-yaml in /frontend-react #53
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 to GHCR | |
| on: | |
| push: | |
| tags: | |
| - 'v*' | |
| branches: | |
| - master | |
| pull_request: | |
| branches: | |
| - master | |
| workflow_dispatch: | |
| jobs: | |
| get_tag: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Determine deployment tag | |
| id: deployment_tag | |
| run: | | |
| if [[ '${{ github.ref_type }}' == 'tag' ]]; then | |
| export tag=${{ github.ref_name }} | |
| echo "version tag is $tag" | |
| echo "id=$tag" >> $GITHUB_OUTPUT | |
| else | |
| export tag=latest | |
| echo "version tag is $tag" | |
| echo "id=$tag" >> $GITHUB_OUTPUT | |
| fi | |
| outputs: | |
| deployment_tag: ${{ steps.deployment_tag.outputs.id }} | |
| build-and-push: | |
| needs: [ get_tag ] | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| packages: write | |
| steps: | |
| # Step 1: checkout code | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| # Step 2: login to GCHR | |
| - name: Log in to GitHub Container Registry | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| # Step 3: Build and push the Docker image | |
| - name: Build and push Docker image | |
| uses: docker/build-push-action@v5 | |
| with: | |
| context: . # Build context (root directory, adjust if Dockerfile is elsewhere) | |
| file: ./Dockerfile # Path to Dockerfile | |
| push: ${{ github.event_name != 'pull_request' }} # Only push on push events, not PRs | |
| tags: | | |
| ghcr.io/bsv-blockchain/teranode-p2p-poc:${{ github.sha }} | |
| ghcr.io/bsv-blockchain/teranode-p2p-poc:${{ needs.get_tag.outputs.deployment_tag }} | |