Skip to content

chore(release): v0.9.0 #31

chore(release): v0.9.0

chore(release): v0.9.0 #31

Workflow file for this run

name: Publish Docker image on tag
on:
push:
tags:
- 'v*'
jobs:
publish:
strategy:
matrix:
runner-platform:
- ubuntu-latest
- buildjet-4vcpu-ubuntu-2204-arm
include:
- runner-platform: ubuntu-latest
build-arch: linux/amd64
tagged-platform: amd64
- runner-platform: buildjet-4vcpu-ubuntu-2204-arm
build-arch: linux/arm64
tagged-platform: arm64
runs-on: ${{ matrix.runner-platform }}
steps:
- name: Set up Buildx
uses: docker/setup-buildx-action@v1
- name: Cache Docker layers
uses: actions/cache@v2
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-prs-${{ matrix.build-arch }}-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-prs-${{ matrix.build-arch }}
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push
id: docker_build
uses: docker/build-push-action@v2
with:
push: true
tags: codetheweb/aoede:${{ github.sha }}-${{ matrix.tagged-platform }}
platforms: ${{ matrix.build-arch }}
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache,mode=min
combine:
name: Combine platform tags
runs-on: ubuntu-latest
needs: publish
steps:
- uses: actions/checkout@v1
- name: Set up Buildx
uses: docker/setup-buildx-action@v1
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Get tags
id: get-tags
uses: Surgo/docker-smart-tag-action@v1
with:
docker_image: codetheweb/aoede
- name: Combine tags
run: docker buildx imagetools create $(echo '${{ steps.get-tags.outputs.tag }}' | tr "," "\0" | xargs -0 printf -- '-t %s ') 'codetheweb/aoede:${{ github.sha }}-arm64' 'codetheweb/aoede:${{ github.sha }}-amd64'
- name: Update Docker Hub description
uses: peter-evans/[email protected]
env:
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKERHUB_PASSWORD: ${{ secrets.DOCKERHUB_PASSWORD }}
DOCKERHUB_REPOSITORY: codetheweb/aoede