Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
70 changes: 70 additions & 0 deletions .github/workflows/manual-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
name: Docker-GHCR Manual Publish

on:
schedule:
- cron: '10 1 6,21 * *'
workflow_dispatch:

jobs:
build-push:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write

steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Prepare
id: prep
run: |
DOCKERHUB_IMAGE=linuxcontainers/mariadb
GHCR_IMAGE=ghcr.io/${{ github.repository_owner }}/mariadb
LATESTTAG=$(git describe --abbrev=0 --tags)
VERSION=${LATESTTAG#v}
MINOR=${VERSION%.*}
MAJOR=${VERSION%%.*}
TAGS="${DOCKERHUB_IMAGE}:${MAJOR},${DOCKERHUB_IMAGE}:${MINOR}"
TAGS="${TAGS},${DOCKERHUB_IMAGE}:${VERSION},${DOCKERHUB_IMAGE}:latest"
TAGS="${TAGS},${GHCR_IMAGE}:${MAJOR},${GHCR_IMAGE}:${MINOR}"
TAGS="${TAGS},${GHCR_IMAGE}:${VERSION},${GHCR_IMAGE}:latest"
echo ::set-output name=tags::${TAGS}
echo ::set-output name=version::${VERSION}
echo ::set-output name=dockerhub_image::${DOCKERHUB_IMAGE}
echo ::set-output name=ghcr_image::${GHCR_IMAGE}

- name: Set up QEMU
uses: docker/setup-qemu-action@v1
with:
platforms: all

- name: Set up Docker Buildx
id: 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: Login to Github Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GHCR_TOKEN }}

- name: Build and push
uses: docker/build-push-action@v2
with:
builder: ${{ steps.buildx.outputs.name }}
context: .
file: ./Dockerfile
push: ${{ github.event_name != 'pull_request' }}
platforms: linux/amd64,linux/arm64
tags: ${{ steps.prep.outputs.tags }}
labels: org.opencontainers.image.version=${{ steps.prep.outputs.version }}
Empty file modified docker-entrypoint.sh
100644 → 100755
Empty file.