🐳 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
1 changed files with 68 additions and 27 deletions

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: Set up QEMU - name: 🔖 Get App Version
uses: tyankatsu0105/read-package-version-actions@v1
id: package-version
- name: 🗂️ Make Docker Meta
id: meta
uses: docker/metadata-action@v3
with:
images: |
${{ env.DH_IMAGE }}
ghcr.io/${{ env.GH_IMAGE }}
tags: |
type=ref,event=tag,suffix={{tag}}
type=semver,pattern={{raw}},value=${{ steps.package-version.outputs.version }},prefix=release-
labels: |
maintainer=Lissy93
org.opencontainers.image.title=Dashy
org.opencontainers.image.description=A self-hosted startpage for your server
org.opencontainers.image.documentation=https://dashy.to/docs
org.opencontainers.image.authors=Alicia Sykes
org.opencontainers.image.licenses=MIT
- name: 🔧 Set up QEMU
uses: docker/setup-qemu-action@v1 uses: docker/setup-qemu-action@v1
-
name: Set up Docker Buildx - name: 🔧 Set up Docker Buildx
uses: docker/setup-buildx-action@v1 uses: docker/setup-buildx-action@v1
-
name: Login to DockerHub - name: 🔑 Login to DockerHub
uses: docker/login-action@v1 uses: docker/login-action@v1
with: with:
username: ${{ secrets.DOCKER_USERNAME }} username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }} password: ${{ secrets.DOCKER_PASSWORD }}
-
name: Build and push - 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 uses: docker/build-push-action@v2
with: with:
context: . context: .
dockerfile: ./docker/Dockerfile-multi-arch dockerfile: ./docker/Dockerfile-multi-arch
platforms: linux/amd64,linux/arm64,linux/arm/v7 platforms: linux/amd64,linux/arm64,linux/arm/v7
push: true push: true
tags: ${{ secrets.DOCKER_REPO }}:latest 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 }}