feat: Boostrap OpenCRVS node (ocrvs-9792) #88
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 and Push Runner Image | |
| on: | |
| push: | |
| branches: ["*"] | |
| paths: | |
| - .github/workflows/build-and-push-runner-image.yml | |
| - github-runner/Dockerfile # Trigger when Dockerfile changes | |
| - github-runner/** # Optional: if your Docker context is in a folder | |
| jobs: | |
| build-and-push: | |
| runs-on: ubuntu-24.04 | |
| permissions: | |
| contents: read | |
| packages: write | |
| env: | |
| image_path: ghcr.io/opencrvs/opencrvs-github-runner | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v5 | |
| - name: Log in to GitHub Container Registry | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Build Docker image | |
| run: | | |
| COMMIT_HASH=$(echo ${{ github.sha }} | cut -c1-7) | |
| echo "image_tag=${COMMIT_HASH}" >> $GITHUB_ENV | |
| docker build -t ${{ env.image_path }}:${COMMIT_HASH} -f github-runner/Dockerfile github-runner/ | |
| - name: Push Docker image | |
| run: | | |
| docker push ${{ env.image_path }}:${{ env.image_tag }} | |
| docker tag ${{ env.image_path }}:${{ env.image_tag }} ${{ env.image_path }}:latest | |
| docker push ${{ env.image_path }}:latest |