attempt multi-arch epitome build #32
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: Docker Build and Push Epitome Image | |
on: | |
push: | |
branches: | |
- dev | |
- main | |
tags: | |
- "v*.*.*" | |
paths: | |
- "epitome/**" | |
- ".github/workflows/epitome.yml" | |
pull_request: | |
branches: | |
- main | |
- dev | |
# schedule: | |
# - cron: "0 10 * * *" | |
env: | |
BRANCH_NAME: ${{ github.head_ref || github.ref_name }} | |
jobs: | |
build-and-push: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Docker meta | |
id: meta | |
uses: docker/metadata-action@v5 | |
with: | |
images: | | |
ghcr.io/hyperboliclabs/hyper-dos/epitome | |
# generate Docker tags based on the following events/attributes | |
tags: | | |
type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', 'main') }} | |
type=schedule | |
type=ref,event=branch | |
type=ref,event=pr | |
type=semver,pattern={{version}} | |
type=semver,pattern={{major}}.{{minor}} | |
type=semver,pattern={{major}} | |
type=sha | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
# Setting up Docker Buildx with docker-container driver is required | |
# at the moment to be able to use a subdirectory with Git context | |
- name: Set up Docker Buildx | |
# we don't need to run the usual 'checkout' action, buildx takes care of it. | |
uses: docker/setup-buildx-action@v3 | |
- name: Login to Github Container Registry | |
if: github.event_name != 'pull_request' | |
uses: docker/login-action@v3 | |
# https://github.com/marketplace/actions/docker-login | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build and push | |
uses: docker/build-push-action@v5 | |
with: | |
platforms: linux/amd64,linux/arm/v6,linux/arm64 | |
context: "{{defaultContext}}:epitome" | |
push: ${{ github.event_name != 'pull_request' }} | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} |