diff --git a/.github/workflows/container.yml b/.github/workflows/container.yml new file mode 100644 index 0000000..d8ef0f6 --- /dev/null +++ b/.github/workflows/container.yml @@ -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} diff --git a/.github/workflows/releaseNigthly.yml b/.github/workflows/releaseNigthly.yml index 00234ca..dd3ebe5 100644 --- a/.github/workflows/releaseNigthly.yml +++ b/.github/workflows/releaseNigthly.yml @@ -7,30 +7,7 @@ on: schedule: - cron: '0 1 * * *' -env: - DOCKER_VERSION: 32 - 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: strategy: fail-fast: false