Skip to content

Ignore claude

Ignore claude #99

Workflow file for this run

name: Build and Push to GHCR
on:
push:
tags:
- 'v*'
branches:
- main
pull_request:
branches:
- main
workflow_dispatch:
permissions: {}
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@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
# Step 2: login to GCHR
- name: Log in to GitHub Container Registry
uses: docker/login-action@c94ce9fb468520275223c153574b00df6fe4bcc9 # 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@ca052bb54ab0790a636c9b5f226502c73d547a25 # 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/arcade:${{ github.sha }}
ghcr.io/bsv-blockchain/arcade:${{ needs.get_tag.outputs.deployment_tag }}