Skip to content

New release: 1.12.1 #21

New release: 1.12.1

New release: 1.12.1 #21

Workflow file for this run

name: 'Publish image builds to Docker Hub'
on:
push:
tags: [ 'v*' ]
jobs:
publish:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- dockerfile: docker/backup/Dockerfile
image: seart/ghs-backup
- dockerfile: docker/database/Dockerfile
image: seart/ghs-database
- dockerfile: docker/migration/Dockerfile
image: seart/ghs-migration
- dockerfile: docker/server/Dockerfile
image: seart/ghs-server
- dockerfile: docker/website/Dockerfile
image: seart/ghs-website
steps:
- name: Checkout latest
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: seart
password: ${{ secrets.DOCKERHUB_TOKEN }}
- id: meta
name: Extract metadata for Docker
uses: actions/github-script@v7
with:
script: |
const patch = context.ref.substring(11)
const parts = patch.split('.')
const minor = `${parts[0]}.${parts[1]}`
const major = parts[0]
core.setOutput('tag-patch', patch)
core.setOutput('tag-minor', minor)
core.setOutput('tag-major', major)
- name: Build and push image
uses: docker/build-push-action@v5
with:
context: .
push: true
file: ${{ matrix.dockerfile }}
tags: |
${{ matrix.image }}:latest
${{ matrix.image }}:${{ steps.meta.outputs.tag-major }}
${{ matrix.image }}:${{ steps.meta.outputs.tag-minor }}
${{ matrix.image }}:${{ steps.meta.outputs.tag-patch }}