fix: unmatched path by action-validator #93
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 container images" | |
| on: | |
| push: | |
| branches: | |
| - develop | |
| - main | |
| paths-ignore: | |
| - '.devcontainer/devcontainer.json' | |
| - '.github/CODEOWNERS' | |
| - '.github/dependabot.yml' | |
| - '.github/FUNDING.yml' | |
| - '.github/README.md' | |
| - '.github/README_JA.md' | |
| - '.github/workflows/ci.yaml' | |
| - '.github/workflows/update-flake-lock.yaml' | |
| - 'assets/**/*' | |
| - 'docs/**/*' | |
| - 'k8s/**/*' | |
| - 'nas/**/*' | |
| - 'secrets/**/*' | |
| - 'terraform/**/*' | |
| - '.gitattributes' | |
| - '.gitignore' | |
| - '.sops.yaml' | |
| - 'AGENTS.md' | |
| - 'Justfile' | |
| - 'LICENSE' | |
| - 'VERSION' | |
| - 'typos.toml' | |
| - 'nix/hosts/**/*' | |
| - 'nix/templates/**/*' | |
| - 'nix/README*' | |
| workflow_dispatch: | |
| env: | |
| REGISTRY: ghcr.io | |
| IMAGE_NAME: ${{ github.repository }} | |
| jobs: | |
| compute-tags: | |
| runs-on: ubuntu-24.04 | |
| permissions: | |
| contents: read | |
| outputs: | |
| IMAGE_TAGS: ${{ steps.tags.outputs.IMAGE_TAGS }} | |
| steps: | |
| - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 | |
| with: | |
| persist-credentials: false | |
| - id: tags | |
| run: | | |
| set -euo pipefail | |
| branch="${GITHUB_REF_NAME}" | |
| if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then | |
| TAG="_debug-${GITHUB_SHA}" | |
| { | |
| echo "IMAGE_TAGS<<EOF" | |
| echo "${REGISTRY}/${IMAGE_NAME}:${TAG}" | |
| echo "EOF" | |
| } >> "$GITHUB_OUTPUT" | |
| exit 0 | |
| fi | |
| if [ "$branch" = "main" ]; then | |
| VERSION=$(cat VERSION) | |
| { | |
| echo "IMAGE_TAGS<<EOF" | |
| echo "${REGISTRY}/${IMAGE_NAME}:${VERSION}" | |
| echo "${REGISTRY}/${IMAGE_NAME}:latest" | |
| echo "EOF" | |
| } >> "$GITHUB_OUTPUT" | |
| exit 0 | |
| fi | |
| { | |
| echo "IMAGE_TAGS<<EOF" | |
| echo "${REGISTRY}/${IMAGE_NAME}:unstable" | |
| echo "EOF" | |
| } >> "$GITHUB_OUTPUT" | |
| build-arch-images: | |
| needs: compute-tags | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - os: ubuntu-24.04 | |
| arch: amd64 | |
| - os: ubuntu-24.04-arm | |
| arch: arm64 | |
| runs-on: ${{ matrix.os }} | |
| permissions: | |
| contents: read | |
| packages: write | |
| env: | |
| IMAGE_TAGS: ${{ needs.compute-tags.outputs.IMAGE_TAGS }} | |
| steps: | |
| - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 | |
| with: | |
| persist-credentials: false | |
| - uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 # v3.11.1 | |
| - uses: docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef # v3.6.0 | |
| with: | |
| registry: ${{ env.REGISTRY }} | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - id: prep-tags | |
| run: | | |
| set -euo pipefail | |
| tags="" | |
| while IFS= read -r tag; do | |
| [ -z "$tag" ] && continue | |
| tags+="${tag}-${{ matrix.arch }}," | |
| done <<< "${IMAGE_TAGS}" | |
| tags="${tags%,}" | |
| echo "TAGS=${tags}" >> "$GITHUB_OUTPUT" | |
| - uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # v6.18.0 | |
| with: | |
| context: . | |
| file: .devcontainer/Dockerfile | |
| platforms: linux/${{ matrix.arch }} | |
| push: true | |
| tags: ${{ steps.prep-tags.outputs.TAGS }} | |
| publish-manifest: | |
| needs: | |
| - compute-tags | |
| - build-arch-images | |
| runs-on: ubuntu-24.04 | |
| permissions: | |
| contents: read | |
| packages: write | |
| env: | |
| IMAGE_TAGS: ${{ needs.compute-tags.outputs.IMAGE_TAGS }} | |
| steps: | |
| - uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 # v3.11.1 | |
| - uses: docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef # v3.6.0 | |
| with: | |
| registry: ${{ env.REGISTRY }} | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - run: |- | |
| set -euo pipefail | |
| echo "${IMAGE_TAGS}" | while IFS= read -r tag; do | |
| [ -z "$tag" ] && continue | |
| docker buildx imagetools create \ | |
| --tag "${tag}" \ | |
| "${tag}-amd64" \ | |
| "${tag}-arm64" | |
| done |