mirror of https://github.com/Lissy93/dashy.git
👷 Build a multi-arch image
This commit is contained in:
parent
f034349659
commit
26305693ec
|
@ -12,6 +12,7 @@ env:
|
||||||
jobs:
|
jobs:
|
||||||
build-and-push-image:
|
build-and-push-image:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
if: "!contains(github.event.head_commit.message, '[ci-skip]')"
|
||||||
permissions:
|
permissions:
|
||||||
contents: read
|
contents: read
|
||||||
packages: write
|
packages: write
|
||||||
|
@ -19,12 +20,34 @@ jobs:
|
||||||
# Fetch the code
|
# Fetch the code
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
# Build the image from default Dockerfile
|
|
||||||
- name: Build image
|
- name: Prepare
|
||||||
run: docker build . --file Dockerfile --tag $IMAGE_NAME --label "runnumber=${GITHUB_RUN_ID}"
|
id: prep
|
||||||
|
run: echo ::set-output name=version::${GITHUB_REF##*/}
|
||||||
|
|
||||||
|
# Use QEMU for multi-architecture builds
|
||||||
|
- name: Set up QEMU
|
||||||
|
uses: docker/setup-qemu-action@v1
|
||||||
|
with:
|
||||||
|
platforms: all
|
||||||
|
|
||||||
|
# Use Moby BuildKit
|
||||||
|
- name: Set up Docker Buildx
|
||||||
|
id: buildx
|
||||||
|
uses: docker/setup-buildx-action@v1
|
||||||
|
with:
|
||||||
|
install: true
|
||||||
|
version: latest
|
||||||
|
driver-opts: image=moby/buildkit:master
|
||||||
|
|
||||||
# Login into GH container registry
|
# Login into GH container registry
|
||||||
- name: Log in to registry
|
- name: Log in to registry
|
||||||
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
|
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
|
||||||
|
|
||||||
|
# Build the image from default Dockerfile
|
||||||
|
- name: Build image
|
||||||
|
run: docker build . --file Dockerfile --tag $IMAGE_NAME --label "runnumber=${GITHUB_RUN_ID}"
|
||||||
|
|
||||||
# Push build image
|
# Push build image
|
||||||
- name: Push image
|
- name: Push image
|
||||||
run: |
|
run: |
|
||||||
|
|
Loading…
Reference in New Issue