Move CI container building to a dedicated CI workflow
This commit is contained in:
parent
d3e4111a18
commit
dd1a276d7a
|
@ -0,0 +1,40 @@
|
||||||
|
name: CI Containers
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
paths:
|
||||||
|
- '.github/ci_images/**'
|
||||||
|
release:
|
||||||
|
types: [published]
|
||||||
|
|
||||||
|
env:
|
||||||
|
IMAGE_PREFIX: kiwix/kiwix-build_ci_
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
Container:
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
variant: [bionic, f35, focal, alpine]
|
||||||
|
runs-on: ubuntu-22.04
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Retrieve the code
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: Build & upload dev container image
|
||||||
|
env:
|
||||||
|
IMAGE_NAME: ${IMAGE_PREFIX}${{matrix.variant}}:dev
|
||||||
|
run: |
|
||||||
|
docker build -t ${IMAGE_NAME} - < ${GITHUB_WORKSPACE}/.github/ci_images/${{matrix.variant}}_builder.dockerfile
|
||||||
|
echo "${{ secrets.GHCR_TOKEN }}" | docker login -u "${{ secrets.GHCR_USERNAME }}" --password-stdin
|
||||||
|
docker push ${IMAGE_NAME}
|
||||||
|
|
||||||
|
- name: Build & upload release container image
|
||||||
|
if: github.event.action == 'published'
|
||||||
|
env:
|
||||||
|
IMAGE_NAME: ${IMAGE_PREFIX}${{matrix.variant}}:${GITHUB_REF_NAME}
|
||||||
|
run: |
|
||||||
|
docker build -t ${IMAGE_NAME} - < ${GITHUB_WORKSPACE}/.github/ci_images/${{matrix.variant}}_builder.dockerfile
|
||||||
|
echo "${{ secrets.GHCR_TOKEN }}" | docker login -u "${{ secrets.GHCR_USERNAME }}" --password-stdin
|
||||||
|
docker push --all-tags ${IMAGE_NAME}
|
|
@ -7,30 +7,7 @@ on:
|
||||||
schedule:
|
schedule:
|
||||||
- cron: '0 1 * * *'
|
- cron: '0 1 * * *'
|
||||||
|
|
||||||
env:
|
|
||||||
DOCKER_VERSION: 32
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
Docker:
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
variant: [bionic, f35, focal, alpine]
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v3
|
|
||||||
- name: Build docker image
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
TAGNAME=${{matrix.variant}}-${DOCKER_VERSION}
|
|
||||||
if [ ! $(curl -sflL https://hub.docker.com/v2/repositories/kiwix/kiwix-build_ci/tags/${TAGNAME}) ]
|
|
||||||
then
|
|
||||||
echo "${{secrets.docker_password}}" | docker login -u "${{secrets.docker_username}}" --password-stdin
|
|
||||||
FULLTAGNAME=kiwix/kiwix-build_ci:${TAGNAME}
|
|
||||||
docker build -t ${FULLTAGNAME} - < ${GITHUB_WORKSPACE}/.github/ci_images/${{matrix.variant}}_builder.dockerfile
|
|
||||||
docker push ${FULLTAGNAME}
|
|
||||||
fi
|
|
||||||
|
|
||||||
Linux:
|
Linux:
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
|
|
Loading…
Reference in New Issue