Dispatch change to more repos #23
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ---------------------------------------------------------------------------- | |
# GitHub Actions workflow that updates all Docker images of Castle Game Engine: | |
# | |
# - cge-none (prerequisites, like FPC (stable versuib), | |
# Android SDK/NDK, texture tools...), | |
# - cge-none-fpxXXX (same as cge-none but with alternative FPC version, | |
# see https://hub.docker.com/r/kambi/castle-engine-cloud-builds-tools/ ) | |
# - cge-stable, cge-unstable | |
# | |
# See https://castle-engine.io/docker for more about this Docker image. | |
# ---------------------------------------------------------------------------- | |
name: Update All CGE Docker Images | |
on: | |
push: | |
pull_request: | |
# Allow to manually trigger the workflow. | |
workflow_dispatch: | |
defaults: | |
run: | |
shell: bash | |
# Split build.sh into 3 smaller jobs, | |
# to avoid "disk size exceeded" errors from GH actions on GH-hosted runners. | |
# As a bonus: build-stable and build-unstable can run in parallel. | |
jobs: | |
build-none: | |
name: Build cge-none, cge-none-fpxXXX | |
# Since we upload Docker images in this job (and the Docker images are | |
# not tagged with GitHub branch) we should not run this on every branch. | |
if: ${{ github.ref == 'refs/heads/master' }} | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: cge-none, cge-none-fpxXXX | |
env: | |
DOCKER_USER: ${{ secrets.DOCKER_USER }} | |
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} | |
DOCKER_GITHUB_USER: ${{ secrets.DOCKER_GITHUB_USER }} | |
DOCKER_GITHUB_TOKEN: ${{ secrets.DOCKER_GITHUB_TOKEN }} | |
run: | | |
set -euo pipefail | |
IFS=$'\n\t' | |
source build-common.sh | |
do_everything_for_image_none | |
build-stable: | |
name: Build stable | |
# Since we upload Docker images in this job (and the Docker images are | |
# not tagged with GitHub branch) we should not run this on every branch. | |
if: ${{ github.ref == 'refs/heads/master' }} | |
runs-on: ubuntu-latest | |
needs: [build-none] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: cge-stable | |
env: | |
DOCKER_USER: ${{ secrets.DOCKER_USER }} | |
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} | |
DOCKER_GITHUB_USER: ${{ secrets.DOCKER_GITHUB_USER }} | |
DOCKER_GITHUB_TOKEN: ${{ secrets.DOCKER_GITHUB_TOKEN }} | |
run: | | |
set -euo pipefail | |
IFS=$'\n\t' | |
source build-common.sh | |
do_everything_for_image_stable | |
build-unstable: | |
name: Build cge-unstable | |
# Since we upload Docker images in this job (and the Docker images are | |
# not tagged with GitHub branch) we should not run this on every branch. | |
if: ${{ github.ref == 'refs/heads/master' }} | |
runs-on: ubuntu-latest | |
needs: [build-none] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: cge-unstable | |
env: | |
DOCKER_USER: ${{ secrets.DOCKER_USER }} | |
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} | |
DOCKER_GITHUB_USER: ${{ secrets.DOCKER_GITHUB_USER }} | |
DOCKER_GITHUB_TOKEN: ${{ secrets.DOCKER_GITHUB_TOKEN }} | |
run: | | |
set -euo pipefail | |
IFS=$'\n\t' | |
source build-common.sh | |
do_everything_for_image_unstable | |
after_build: | |
name: After Build | |
needs: [build-none, build-stable, build-unstable] | |
uses: ./.github/workflows/after-build.yml | |
# Pass secrets to the after-build.yml, otherwise they are not available there. | |
# See https://docs.github.com/en/actions/using-workflows/reusing-workflows#passing-inputs-and-secrets-to-a-reusable-workflow | |
secrets: | |
GH_TOKEN_DISPATCH_AFTER_UPDATE: ${{ secrets.GH_TOKEN_DISPATCH_AFTER_UPDATE }} |