Update Docker image for ongoing branches #1775
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
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 }} |