-
-
Notifications
You must be signed in to change notification settings - Fork 2
54 lines (48 loc) · 1.98 KB
/
update-docker-cge-unstable.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
# ----------------------------------------------------------------------------
# GitHub Actions workflow that updates Docker image of Castle Game Engine
# with latest unstable (snapshot) CGE version.
# That is, Docker image kambi/castle-engine-cloud-builds-tools:cge-unstable,
# which is
# - cge-unstable tag
# - of https://hub.docker.com/r/kambi/castle-engine-cloud-builds-tools/ .
#
# See https://castle-engine.io/docker for more about this Docker image.
# ----------------------------------------------------------------------------
name: Update CGE Docker Image cge-unstable
on:
push:
pull_request:
repository_dispatch:
types: [cge-snapshot-changed]
defaults:
run:
shell: bash
jobs:
build:
name: Build
# 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:
- name: Castle Game Engine GIT SHA that caused this action
run: echo "${{ github.event.client_payload.cge_commit_sha }}"
- uses: actions/checkout@v4
- name: Update Docker image
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: ./build-cge-unstable.sh
# On self-hosted machine, we would do additionally
# ./remove_unused_docker_images.sh
# Seems not necessary on GH-hosted machine, as they are cleaned each time.
after_build:
name: After Build
needs: build
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 }}