Skip to content

Docker Publish

Docker Publish #54

Workflow file for this run

name: Docker Publish
on:
push:
branches:
- 'main'
tags:
- 'base-httpd-*'
- 'kiwix-serve-*'
- 'edupi-*'
- 'file-browser-*'
- 'captive-portal-*'
- 'reverse-proxy-*'
- 'dashboard-*'
- 'wikifundi-*'
- 'hwclock-*'
jobs:
identify:
name: Identify which projects to build
runs-on: ubuntu-22.04
outputs:
base-httpd: ${{ steps.ident.outputs.base-httpd }}
kiwix-serve: ${{ steps.ident.outputs.kiwix-serve }}
edupi: ${{ steps.ident.outputs.edupi }}
file-browser: ${{ steps.ident.outputs.file-browser }}
captive-portal: ${{ steps.ident.outputs.captive-portal }}
reverse-proxy: ${{ steps.ident.outputs.reverse-proxy }}
dashboard: ${{ steps.ident.outputs.dashboard }}
wikifundi: ${{ steps.ident.outputs.wikifundi }}
hwclock: ${{ steps.ident.outputs.hwclock }}
steps:
- uses: actions/checkout@v3.4.0
with:
fetch-depth: 2
- name: Get changed files
id: files
uses: tj-actions/changed-files@v34.3.4
with:
separator: ','
- id: ident
shell: python
env:
FILES: ${{ steps.files.outputs.all_changed_and_modified_files }}
run: |
import os
print("changed-files", os.getenv("FILES"))
projects = set()
# for tags like `base-httpd-2.0.1`
if os.getenv("GITHUB_REF_TYPE") == "tag":
projects.add(os.getenv("GITHUB_REF_NAME").rsplit("-", 1)[0])
for fname in os.getenv("FILES").split(","):
if len(fname.split("/")) > 1:
projects.add(fname.split("/")[0])
for project in projects:
with open(os.getenv("GITHUB_OUTPUT"), "a") as fh:
fh.write("{project}=yes\n".format(project=project))
base-httpd:
name: Publish base-httpd Image
runs-on: ubuntu-22.04
needs: identify
if: ${{ needs.identify.outputs.base-httpd == 'yes' }}
steps:
- uses: actions/checkout@v3.4.0
- name: Publish base-httpd Image
uses: openzim/docker-publish-action@v10
with:
image-name: offspot/base-httpd
on-master: dev
tag-pattern: /^base-httpd-([0-9.]+)$/
restrict-to: offspot/container-images
platforms: |
linux/amd64
linux/arm64
context: base-httpd
registries: ghcr.io
credentials:
GHCRIO_USERNAME=${{ secrets.GHCR_USERNAME }}
GHCRIO_TOKEN=${{ secrets.GHCR_TOKEN }}
kiwix-serve:
name: Publish kiwix-serve Image
runs-on: ubuntu-22.04
needs: identify
if: ${{ needs.identify.outputs.kiwix-serve == 'yes' }}
steps:
- uses: actions/checkout@v3.4.0
- name: Publish kiwix-serve Image
uses: openzim/docker-publish-action@v10
with:
image-name: offspot/kiwix-serve
on-master: dev
build-args:
VERSION={tag}
tag-pattern: /^kiwix-serve-([0-9.]+)$/
restrict-to: offspot/container-images
platforms: |
linux/amd64
linux/arm64
context: kiwix-serve
registries: ghcr.io
credentials:
GHCRIO_USERNAME=${{ secrets.GHCR_USERNAME }}
GHCRIO_TOKEN=${{ secrets.GHCR_TOKEN }}
edupi:
name: Publish edupi Image
runs-on: ubuntu-22.04
needs: identify
if: ${{ needs.identify.outputs.edupi == 'yes' }}
steps:
- uses: actions/checkout@v3.4.0
- name: Publish edupi Image
uses: openzim/docker-publish-action@v10
with:
image-name: offspot/edupi
on-master: dev
build-args:
VERSION={tag}
tag-pattern: /^edupi-([0-9.]+)$/
restrict-to: offspot/container-images
platforms: |
linux/amd64
linux/arm64
context: edupi
registries: ghcr.io
credentials:
GHCRIO_USERNAME=${{ secrets.GHCR_USERNAME }}
GHCRIO_TOKEN=${{ secrets.GHCR_TOKEN }}
file-browser:
name: Publish file-browser Image
runs-on: ubuntu-22.04
needs: identify
if: ${{ needs.identify.outputs.file-browser == 'yes' }}
steps:
- uses: actions/checkout@v3.4.0
- name: Publish file-browser Image
uses: openzim/docker-publish-action@v10
with:
image-name: offspot/file-browser
on-master: dev
build-args:
VERSION={tag}
tag-pattern: /^file-browser-([0-9.]+)$/
restrict-to: offspot/container-images
platforms: |
linux/amd64
linux/arm64
context: file-browser
registries: ghcr.io
credentials:
GHCRIO_USERNAME=${{ secrets.GHCR_USERNAME }}
GHCRIO_TOKEN=${{ secrets.GHCR_TOKEN }}
captive-portal:
name: Publish captive-portal Image
runs-on: ubuntu-22.04
needs: identify
if: ${{ needs.identify.outputs.captive-portal == 'yes' }}
steps:
- uses: actions/checkout@v3.4.0
- name: Publish captive-portal Image
uses: openzim/docker-publish-action@v10
with:
image-name: offspot/captive-portal
on-master: dev
build-args:
VERSION={tag}
tag-pattern: /^captive-portal-([0-9.]+)$/
restrict-to: offspot/container-images
platforms: |
linux/amd64
linux/arm64
context: captive-portal
registries: ghcr.io
credentials:
GHCRIO_USERNAME=${{ secrets.GHCR_USERNAME }}
GHCRIO_TOKEN=${{ secrets.GHCR_TOKEN }}
reverse-proxy:
name: Publish reverse-proxy Image
runs-on: ubuntu-22.04
needs: identify
if: ${{ needs.identify.outputs.reverse-proxy == 'yes' }}
steps:
- uses: actions/checkout@v3.4.0
- name: Publish reverse-proxy Image
uses: openzim/docker-publish-action@v10
with:
image-name: offspot/reverse-proxy
on-master: dev
build-args:
VERSION={tag}
tag-pattern: /^reverse-proxy-([0-9.]+)$/
restrict-to: offspot/container-images
platforms: |
linux/amd64
linux/arm64
context: reverse-proxy
registries: ghcr.io
credentials:
GHCRIO_USERNAME=${{ secrets.GHCR_USERNAME }}
GHCRIO_TOKEN=${{ secrets.GHCR_TOKEN }}
dashboard:
name: Publish dashboard Image
runs-on: ubuntu-22.04
needs: identify
if: ${{ needs.identify.outputs.dashboard == 'yes' }}
steps:
- uses: actions/checkout@v3.4.0
- name: Publish dashboard Image
uses: openzim/docker-publish-action@v10
with:
image-name: offspot/dashboard
on-master: dev
build-args:
VERSION={tag}
tag-pattern: /^dashboard-([0-9.]+)$/
restrict-to: offspot/container-images
platforms: |
linux/amd64
linux/arm64
context: dashboard
registries: ghcr.io
credentials:
GHCRIO_USERNAME=${{ secrets.GHCR_USERNAME }}
GHCRIO_TOKEN=${{ secrets.GHCR_TOKEN }}
wikifundi:
name: Publish wikifundi Image
runs-on: ubuntu-22.04
needs: identify
if: ${{ needs.identify.outputs.wikifundi == 'yes' }}
steps:
- uses: actions/checkout@v3.4.0
- name: Publish wikifundi Image
uses: openzim/docker-publish-action@v10
with:
image-name: offspot/wikifundi
on-master: dev
build-args:
VERSION={tag}
tag-pattern: /^wikifundi-([0-9.]+)$/
restrict-to: offspot/container-images
platforms: |
linux/amd64
linux/arm64
context: wikifundi
registries: ghcr.io
credentials:
GHCRIO_USERNAME=${{ secrets.GHCR_USERNAME }}
GHCRIO_TOKEN=${{ secrets.GHCR_TOKEN }}
hwclock:
name: Publish hwclock Image
runs-on: ubuntu-22.04
needs: identify
if: ${{ needs.identify.outputs.hwclock == 'yes' }}
steps:
- uses: actions/checkout@v3.4.0
- name: Publish hwclock Image
uses: openzim/docker-publish-action@v10
with:
image-name: offspot/hwclock
on-master: dev
build-args:
VERSION={tag}
tag-pattern: /^hwclock-([0-9.]+)$/
restrict-to: offspot/container-images
platforms: |
linux/amd64
linux/arm64
context: hwclock
registries: ghcr.io
credentials:
GHCRIO_USERNAME=${{ secrets.GHCR_USERNAME }}
GHCRIO_TOKEN=${{ secrets.GHCR_TOKEN }}