-
Notifications
You must be signed in to change notification settings - Fork 9
69 lines (67 loc) · 2.67 KB
/
ongoing-branch.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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
name: Update Docker image for ongoing branches
on:
schedule:
- cron: "0 */12 * * *"
repository_dispatch:
types:
- build-ongoing
jobs:
build:
runs-on: ubuntu-latest
env:
DOCKER5_BUILDBRANCH: develop
strategy:
matrix:
data:
- php_version: "8.1"
composer_version: "2"
phpunit_version: ccm
c5_startingpoint: atomik_full
image_tag: develop-full
- php_version: "8.1"
composer_version: "2"
phpunit_version: ccm
c5_startingpoint: atomik_blank
image_tag: develop
name: Update ongoing Docker image
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Check if build is needed for ${{ matrix.data.c5_startingpoint }}
id: check
run: ./.github/workflows/ongoing-branch-check ${{ matrix.data.c5_startingpoint }}
- name: Fetch base Docker image
if: steps.check.outputs.BUILD_SHA1
run: echo docker pull ghcr.io/concrete5-community/docker5:base
- name: Build with starting point ${{ matrix.data.c5_startingpoint }}
if: steps.check.outputs.BUILD_SHA1
run: >
docker build
--build-arg CCM_PHP_VERSION=${{ matrix.data.php_version }}
--build-arg CCM_COMPOSER_VERSION=${{ matrix.data.composer_version }}
--build-arg CCM_PHPUNIT_VERSION=${{ matrix.data.phpunit_version }}
--build-arg CCM_C5_ARCHIVE=https://codeload.github.com/concretecms/concretecms/tar.gz/${{ steps.check.outputs.BUILD_SHA1 }}
--build-arg CCM_STARTING_POINT=${{ matrix.data.c5_startingpoint }}
--build-arg CCM_PATCH_ENVIRONMENT_ONLY=N
--tag ghcr.io/concrete5-community/docker5:${{ matrix.data.image_tag }}
./installed
- name: Check that MariaDB works
if: steps.check.outputs.BUILD_SHA1
run: docker run --rm --entrypoint='' ghcr.io/concrete5-community/docker5:${{ matrix.data.image_tag }} ccm-service start db
- name: Login to the Docker container registry
if: steps.check.outputs.BUILD_SHA1
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Publish image
if: steps.check.outputs.BUILD_SHA1
run: docker push ghcr.io/concrete5-community/docker5:${{ matrix.data.image_tag }}
- name: Update repository
if: steps.check.outputs.BUILD_SHA1
env:
BUILT_SHA1: ${{ steps.check.outputs.BUILD_SHA1 }}
run: ./.github/workflows/ongoing-branch-updated ${{ matrix.data.c5_startingpoint }}