build and add PAT #306
This file contains 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: konductor | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- main | |
paths-ignore: | |
- '.devcontainer/**' | |
- '.devcontainer.json' | |
- 'devcontainer.json' | |
- 'docs/**' | |
- '**.md' | |
pull_request: | |
branches: | |
- main | |
paths-ignore: | |
- '.devcontainer/**' | |
- '.devcontainer.json' | |
- 'devcontainer.json' | |
- 'docs/**' | |
- '**.md' | |
schedule: | |
- cron: '0 0 * * *' | |
env: | |
IMAGE: ghcr.io/containercraft/konductor | |
REGISTRY: ghcr.io | |
IMAGE_NAME: konductor | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
packages: write | |
actions: write | |
steps: | |
- | |
name: Git Checkout | |
uses: actions/checkout@v4 | |
id: git | |
with: | |
clean: '' | |
submodules: 'recursive' | |
ref: ${{ github.event.client_payload.sha }} | |
- | |
name: Setup QEMU | |
uses: docker/setup-qemu-action@v3 | |
id: qemu | |
- | |
name: Setup Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
id: buildx | |
- | |
id: repository_owner | |
uses: Entepotenz/change-string-case-action-min-dependencies@v1 | |
with: | |
string: ${{ github.repository_owner }} | |
- | |
id: repository | |
uses: Entepotenz/change-string-case-action-min-dependencies@v1 | |
with: | |
string: ${{ github.repository }} | |
- | |
name: Registry Login | |
uses: docker/login-action@v3 | |
id: docker-login | |
with: | |
registry: ghcr.io | |
username: ${{ steps.repository_owner.outputs.lowercase }} | |
password: ${{ secrets.GHA_GITHUB_TOKEN }} | |
- | |
if: ${{ github.event_name == 'push' }} && ${{ !github.ref == 'refs/heads/main' }} | |
name: Container Build | |
uses: docker/build-push-action@v5 | |
id: container-build | |
with: | |
push: false | |
cache-to: ghcr.io/${{ steps.repository.outputs.lowercase }}:${{ github.sha }} | |
context: . | |
file: Dockerfile | |
platforms: linux/amd64,linux/arm64 | |
tags: "ghcr.io/${{ steps.repository.outputs.lowercase }}:latest,ghcr.io/${{ steps.repository.outputs.lowercase }}:${{ github.sha }}" | |
- | |
if: ${{ github.event_name == 'push' }} && ${{ github.ref == 'refs/heads/main' }} | |
name: Container Push | |
uses: docker/build-push-action@v5 | |
id: container-push | |
with: | |
push: true | |
cache-from: ghcr.io/${{ steps.repository.outputs.lowercase }}:${{ github.sha }} | |
context: . | |
file: Dockerfile | |
platforms: linux/amd64,linux/arm64 | |
tags: "ghcr.io/${{ steps.repository.outputs.lowercase }}:latest,ghcr.io/${{ steps.repository.outputs.lowercase }}:${{ github.sha }}" |