name: Publish Docker image on: push: branches: - master tags: - 'v*' workflow_dispatch: permissions: contents: read concurrency: group: publish-pulse-${{ github.ref }} cancel-in-progress: false jobs: verify: name: Test before publishing runs-on: ubuntu-latest steps: - uses: actions/checkout@v7 - uses: actions/setup-node@v7 with: node-version: 24 cache: npm - run: npm ci - run: npm run typecheck - run: npm run build - run: npm test publish: name: Build and publish GHCR needs: verify runs-on: ubuntu-latest permissions: contents: read packages: write steps: - uses: actions/checkout@v7 - uses: docker/setup-qemu-action@v3 - uses: docker/setup-buildx-action@v3 - name: Login to GHCR uses: docker/login-action@v3 with: registry: ghcr.io username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} - name: Compute image tags id: meta uses: docker/metadata-action@v5 with: images: ghcr.io/mehdimp4/pulse tags: | type=raw,value=latest,enable=${{ github.ref == 'refs/heads/master' }} type=sha,format=short type=ref,event=tag type=semver,pattern={{version}} - name: Publish Linux AMD64 and ARM64 uses: docker/build-push-action@v6 with: context: . push: true platforms: linux/amd64,linux/arm64 tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} cache-from: type=gha cache-to: type=gha,mode=max provenance: true sbom: true