Skip to content

Scheduled Monthly

Scheduled Monthly #20

# See LICENSE file in this repo for license details.
name: Scheduled Monthly
on:
schedule:
# ┌───────────── minute (0 - 59)
# │ ┌───────────── hour (0 - 23)
# │ │ ┌───────────── day of the month (1 - 31)
# │ │ │ ┌───────────── month (1 - 12 or JAN-DEC)
# │ │ │ │ ┌───────────── day of the week (0 - 6 or SUN-SAT)
# │ │ │ │ │
# │ │ │ │ │
# │ │ │ │ │
# * * * * *
- cron: "30 4 1 * *"
# Allow workflow to be triggered manually.
# https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows
workflow_dispatch:
jobs:
git_describe_semver:
name: Generate semantic release version using git-describe-semver
runs-on: ubuntu-latest
# Default: 360 minutes
timeout-minutes: 5
# https://docs.github.com/en/actions/using-jobs/defining-outputs-for-jobs
outputs:
version: ${{ steps.git-describe-semver.outputs.version }}
steps:
- name: Print Docker version
run: docker --version
- name: Clone repo with full history
uses: actions/checkout@v4
with:
# Needed in order to retrieve tags for use with semver calculations
fetch-depth: 0
# Mark the current working directory as a safe directory in git to
# resolve "dubious ownership" complaints.
#
# https://docs.github.com/en/actions/learn-github-actions/variables#default-environment-variables
# https://confluence.atlassian.com/bbkb/git-command-returns-fatal-error-about-the-repository-being-owned-by-someone-else-1167744132.html
# https://github.com/actions/runner-images/issues/6775
# https://github.com/actions/checkout/issues/766
- name: Mark the current working directory as a safe directory in git
# run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
run: git config --global --add safe.directory "${PWD}"
# https://github.com/choffmeister/git-describe-semver/pkgs/container/git-describe-semver
# https://github.com/choffmeister/git-describe-semver/blob/v0.3.11/action.yaml
# https://github.com/choffmeister/git-describe-semver/blob/v0.4.0/action.yaml
# https://github.com/choffmeister/git-describe-semver/issues/8
- name: Record semantic version using git-describe-semver
uses: docker://ghcr.io/choffmeister/git-describe-semver:0.3.11
id: git-describe-semver
with:
args: >-
--fallback="v0.0.0"
--drop-prefix=false
--prerelease-prefix="dev"
--prerelease-suffix=""
--prerelease-timestamped="false"
--format="version=<version>"
$GITHUB_OUTPUT
- name: Print semantic version generated by git-describe-semver
run: |
echo "${{ steps.git-describe-semver.outputs.version }}"
build_and_upload_mirror_images:
name: Build and upload mirror container images
needs: git_describe_semver
runs-on: ubuntu-latest
# Default: 360 minutes
timeout-minutes: 45
steps:
- name: Log tag info
run: |
echo "Ref type: ${{ github.ref_type }}"
echo "Ref name: ${{ github.ref_name }}"
echo "Ref full: ${{ github.ref }}"
echo "Commit SHA: ${{ github.sha }}"
- name: Check out code with default settings
uses: actions/checkout@v4
# Mark the current working directory as a safe directory in git to
# resolve "dubious ownership" complaints.
#
# https://docs.github.com/en/actions/learn-github-actions/variables#default-environment-variables
# https://confluence.atlassian.com/bbkb/git-command-returns-fatal-error-about-the-repository-being-owned-by-someone-else-1167744132.html
# https://github.com/actions/runner-images/issues/6775
# https://github.com/actions/checkout/issues/766
- name: Mark the current working directory as a safe directory in git
# run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
run: git config --global --add safe.directory "${PWD}"
# bsdmainutils provides "column" which is used by the Makefile
- name: Install Ubuntu packages
run: sudo apt-get update && sudo apt-get install -y --no-install-recommends make gcc bsdmainutils
- name: Build mirror images
env:
REPO_VERSION: ${{ needs.git_describe_semver.outputs.version }}
run: |
make build-mirror-images
- name: List generated Docker images
run: docker image ls --filter "label=atc0005.go-ci" --format "table {{.Repository}}\t{{.Tag}}\t{{.ID}}\t{{.Size}}"
build_and_upload_alpine_images:
name: Build and upload Alpine container images
needs: git_describe_semver
runs-on: ubuntu-latest
# Default: 360 minutes
timeout-minutes: 45
steps:
- name: Log tag info
run: |
echo "Ref type: ${{ github.ref_type }}"
echo "Ref name: ${{ github.ref_name }}"
echo "Ref full: ${{ github.ref }}"
echo "Commit SHA: ${{ github.sha }}"
- name: Check out code with default settings
uses: actions/checkout@v4
# Mark the current working directory as a safe directory in git to
# resolve "dubious ownership" complaints.
#
# https://docs.github.com/en/actions/learn-github-actions/variables#default-environment-variables
# https://confluence.atlassian.com/bbkb/git-command-returns-fatal-error-about-the-repository-being-owned-by-someone-else-1167744132.html
# https://github.com/actions/runner-images/issues/6775
# https://github.com/actions/checkout/issues/766
- name: Mark the current working directory as a safe directory in git
# run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
run: git config --global --add safe.directory "${PWD}"
# bsdmainutils provides "column" which is used by the Makefile
- name: Install Ubuntu packages
run: sudo apt-get update && sudo apt-get install -y --no-install-recommends make gcc bsdmainutils
- name: Build Alpine images
env:
REPO_VERSION: ${{ needs.git_describe_semver.outputs.version }}
run: |
make build-alpine-images
- name: List generated Docker images
run: docker image ls --filter "label=atc0005.go-ci" --format "table {{.Repository}}\t{{.Tag}}\t{{.ID}}\t{{.Size}}"
build_and_upload_mingw_images:
name: Build and upload mingw-w64 container images
needs: git_describe_semver
runs-on: ubuntu-latest
# Default: 360 minutes
timeout-minutes: 45
steps:
- name: Log tag info
run: |
echo "Ref type: ${{ github.ref_type }}"
echo "Ref name: ${{ github.ref_name }}"
echo "Ref full: ${{ github.ref }}"
echo "Commit SHA: ${{ github.sha }}"
- name: Check out code with default settings
uses: actions/checkout@v4
# Mark the current working directory as a safe directory in git to
# resolve "dubious ownership" complaints.
#
# https://docs.github.com/en/actions/learn-github-actions/variables#default-environment-variables
# https://confluence.atlassian.com/bbkb/git-command-returns-fatal-error-about-the-repository-being-owned-by-someone-else-1167744132.html
# https://github.com/actions/runner-images/issues/6775
# https://github.com/actions/checkout/issues/766
- name: Mark the current working directory as a safe directory in git
# run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
run: git config --global --add safe.directory "${PWD}"
# bsdmainutils provides "column" which is used by the Makefile
- name: Install Ubuntu packages
run: sudo apt-get update && sudo apt-get install -y --no-install-recommends make gcc bsdmainutils
- name: Build mingw-w64 images
env:
REPO_VERSION: ${{ needs.git_describe_semver.outputs.version }}
run: |
make build-mingw-images
- name: List generated Docker images
run: docker image ls --filter "label=atc0005.go-ci" --format "table {{.Repository}}\t{{.Tag}}\t{{.ID}}\t{{.Size}}"
build_and_upload_standard_images:
name: Build and upload standard container images
needs: git_describe_semver
runs-on: ubuntu-latest
# Default: 360 minutes
timeout-minutes: 45
steps:
- name: Log tag info
run: |
echo "Ref type: ${{ github.ref_type }}"
echo "Ref name: ${{ github.ref_name }}"
echo "Ref full: ${{ github.ref }}"
echo "Commit SHA: ${{ github.sha }}"
- name: Check out code with default settings
uses: actions/checkout@v4
# Mark the current working directory as a safe directory in git to
# resolve "dubious ownership" complaints.
#
# https://docs.github.com/en/actions/learn-github-actions/variables#default-environment-variables
# https://confluence.atlassian.com/bbkb/git-command-returns-fatal-error-about-the-repository-being-owned-by-someone-else-1167744132.html
# https://github.com/actions/runner-images/issues/6775
# https://github.com/actions/checkout/issues/766
- name: Mark the current working directory as a safe directory in git
# run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
run: git config --global --add safe.directory "${PWD}"
# bsdmainutils provides "column" which is used by the Makefile
- name: Install Ubuntu packages
run: sudo apt-get update && sudo apt-get install -y --no-install-recommends make gcc bsdmainutils
- name: Build standard images
env:
REPO_VERSION: ${{ needs.git_describe_semver.outputs.version }}
run: |
make build-standard-images
- name: List generated Docker images
run: docker image ls --filter "label=atc0005.go-ci" --format "table {{.Repository}}\t{{.Tag}}\t{{.ID}}\t{{.Size}}"