🐳 Attempts new multi-arch Docker action

This commit is contained in:
Alicia Sykes 2022-01-23 13:50:19 +00:00
parent 24793c8108
commit 71325c7f3c

View File

@ -1,35 +1,76 @@
name: Build Multiplatform Image name: 🐳 Build + Publish Multi-Platform Image
on: on:
push: push:
branches: branches: ['master']
- 'master' tags: [v*]
env:
DH_IMAGE: ${{ secrets.DOCKER_REPO }}
GH_IMAGE: ${{ github.repository_owner }}/{{ github.event.repository.name }}
jobs: jobs:
docker: docker:
runs-on: ubuntu-latest runs-on: ubuntu-latest
permissions: { contents: read, packages: write }
if: "!contains(github.event.head_commit.message, '[ci-skip]')"
steps: steps:
- - name: 🛎️ Checkout Repo
name: Checkout uses: actions/checkout@v2
uses: actions/checkout@v2
- - name: 🔖 Get App Version
name: Set up QEMU uses: tyankatsu0105/read-package-version-actions@v1
uses: docker/setup-qemu-action@v1 id: package-version
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1 - name: 🗂️ Make Docker Meta
- id: meta
name: Login to DockerHub uses: docker/metadata-action@v3
uses: docker/login-action@v1 with:
with: images: |
username: ${{ secrets.DOCKER_USERNAME }} ${{ env.DH_IMAGE }}
password: ${{ secrets.DOCKER_PASSWORD }} ghcr.io/${{ env.GH_IMAGE }}
- tags: |
name: Build and push type=ref,event=tag,suffix={{tag}}
uses: docker/build-push-action@v2 type=semver,pattern={{raw}},value=${{ steps.package-version.outputs.version }},prefix=release-
with: labels: |
context: . maintainer=Lissy93
dockerfile: ./docker/Dockerfile-multi-arch org.opencontainers.image.title=Dashy
platforms: linux/amd64,linux/arm64,linux/arm/v7 org.opencontainers.image.description=A self-hosted startpage for your server
push: true org.opencontainers.image.documentation=https://dashy.to/docs
tags: ${{ secrets.DOCKER_REPO }}:latest org.opencontainers.image.authors=Alicia Sykes
org.opencontainers.image.licenses=MIT
- name: 🔧 Set up QEMU
uses: docker/setup-qemu-action@v1
- name: 🔧 Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: 🔑 Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: 🔑 Login to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: ⚒️ Build and push
uses: docker/build-push-action@v2
with:
context: .
dockerfile: ./docker/Dockerfile-multi-arch
platforms: linux/amd64,linux/arm64,linux/arm/v7
push: true
tags: |
${{ env.DH_IMAGE }}:latest
${{ env.DH_IMAGE }}:${{ steps.package-version.outputs.version }}
${{ env.GH_IMAGE }}:latest
${{ env.GH_IMAGE }}:${{ steps.package-version.outputs.version }}