Merge pull request #14 from doubleangels/feat/feature-additions-and-t… #12
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: Docker | |
| # Build and publish the panel image to GHCR on every push to main - :latest plus | |
| # an immutable :v<package.json version> tag, multi-arch (amd64 servers, arm64 | |
| # Pi/ARM VPS). Pushing without a version bump republishes both tags for that | |
| # version, which is harmless. Can also be run manually from the Actions tab. | |
| on: | |
| push: | |
| branches: [main] | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| packages: write | |
| jobs: | |
| publish: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - id: version | |
| run: echo "value=$(node -p "require('./package.json').version")" >> "$GITHUB_OUTPUT" | |
| # GHCR/OCI tags must be lowercase - github.repository preserves the | |
| # owner's actual casing (e.g. OwenWright8/...), which buildx rejects. | |
| - name: Lowercase image name | |
| run: echo "IMAGE_NAME=${GITHUB_REPOSITORY,,}" >> "$GITHUB_ENV" | |
| - uses: docker/setup-qemu-action@v3 | |
| - uses: docker/setup-buildx-action@v3 | |
| - uses: docker/login-action@v3 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - uses: docker/build-push-action@v6 | |
| with: | |
| context: . | |
| platforms: linux/amd64,linux/arm64 | |
| push: true | |
| tags: | | |
| ghcr.io/${{ env.IMAGE_NAME }}:latest | |
| ghcr.io/${{ env.IMAGE_NAME }}:v${{ steps.version.outputs.value }} | |
| cache-from: type=gha | |
| cache-to: type=gha,mode=max |