Skip to content

Build and Publish Docker Image #2

Build and Publish Docker Image

Build and Publish Docker Image #2

Workflow file for this run

name: Build and Publish Docker Image
on:
workflow_run:
workflows: ["Test"]
types:
- completed
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract version and commit hash
id: version
run: |

Check failure on line 32 in .github/workflows/push-docker.yml

View workflow run for this annotation

GitHub Actions / Build and Publish Docker Image

Invalid workflow file

The workflow is not valid. .github/workflows/push-docker.yml (Line: 32, Col: 14): Unexpected symbol: 'sha::8'. Located at position 8 within expression: github.sha::8
echo "VERSION=$(jq -r .version < package.json)-${{ github.sha }}" >> $GITHUB_ENV
echo "SHORT_SHA=${{ github.sha::8 }}" >> $GITHUB_ENV
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
platforms: linux/amd64,linux/arm64
push: true
tags: |
ghcr.io/${{ github.repository_owner }}/${{ github.event.repository.name }}:latest,
ghcr.io/${{ github.repository_owner }}/${{ github.event.repository.name }}:${{ env.VERSION }},
ghcr.io/${{ github.repository_owner }}/${{ github.event.repository.name }}:${{ env.VERSION }}-${{ env.SHORT_SHA }}