Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 23 additions & 4 deletions .github/workflows/github-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ on:
jobs:
multi:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
-
name: Checkout
Expand All @@ -29,14 +32,25 @@ jobs:
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
-
name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- if: github.ref == 'refs/heads/main'
name: Conditional(Set tag as `latest`)
run: echo "tag=willfarrell/autoheal:latest" >> $GITHUB_ENV
run: |
echo "tag=willfarrell/autoheal:latest" >> $GITHUB_ENV
echo "ghcr_tag=ghcr.io/${{ github.repository }}:latest" >> $GITHUB_ENV

- if: startsWith(github.ref, 'refs/tags/')
name: Conditional(Set tag as `{version}`)
run: echo "tag=willfarrell/autoheal:${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
run: |
echo "tag=willfarrell/autoheal:${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
echo "ghcr_tag=ghcr.io/${{ github.repository }}:${GITHUB_REF#refs/*/}" >> $GITHUB_ENV

-
name: Build and push
Expand All @@ -46,5 +60,10 @@ jobs:
file: ./Dockerfile
push: true
platforms: linux/386,linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64,linux/ppc64le
tags: |
${{ env.tag }}
tags: ${{ env.tag }}

- if: env.ghcr_tag != ''
name: Mirror to GitHub Container Registry (best-effort)
continue-on-error: true
run: |
docker buildx imagetools create --tag ${{ env.ghcr_tag }} ${{ env.tag }}