Build and Tag Nightly #357
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: Build and Tag Nightly | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: '21 10 * * *' # daily, in the morning (UTC) | |
env: | |
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_ILIOS_DEPLOYMENT_WEBHOOK_URL }} | |
jobs: | |
tags: | |
runs-on: ubuntu-latest | |
name: Extract Semvar Tags | |
outputs: | |
latestTag: ${{ steps.tag.outputs.latestTag }} | |
major: ${{ steps.tag.outputs.major }} | |
minor: ${{ steps.tag.outputs.minor }} | |
patch: ${{ steps.tag.outputs.patch }} | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
token: ${{ secrets.ZORGBORT_TOKEN }} | |
- id: tag | |
run: | | |
LATEST_TAG=$(git describe --tags --abbrev=0) | |
echo ${LATEST_TAG} | |
echo "::set-output name=latestTag::${LATEST_TAG}" | |
MAJOR_VERSION=$(echo $LATEST_TAG | sed -rn 's#^(v3)\.([0-9]+)\.([0-9]+)$#\1#p') | |
echo ${MAJOR_VERSION} | |
echo "::set-output name=major::${MAJOR_VERSION}" | |
MINOR_VERSION=$(echo $LATEST_TAG | sed -rn 's#^(v3)\.([0-9]+)\.([0-9]+)$#\1.\2#p') | |
echo ${MINOR_VERSION} | |
echo "::set-output name=minor::${MINOR_VERSION}" | |
PATCH_VERSION=$(echo $LATEST_TAG | sed -rn 's#^(v3)\.([0-9]+)\.([0-9]+)$#\1.\2.\3#p') | |
echo ${PATCH_VERSION} | |
echo "::set-output name=patch::${PATCH_VERSION}" | |
deploy-docker-containers: | |
needs: tags | |
name: ${{ matrix.image }} Docker (${{needs.tags.outputs.major}},${{needs.tags.outputs.minor}},${{needs.tags.outputs.patch}}) | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
image: | |
- php-apache | |
- nginx | |
- fpm | |
- fpm-dev | |
- admin | |
- update-frontend | |
- consume-messages | |
- mysql | |
- mysql-demo | |
- opensearch | |
- redis | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
ref: ${{needs.tags.outputs.latestTag}} | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
with: | |
image: tonistiigi/binfmt:latest | |
platforms: linux/amd64,linux/arm64 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Login to DockerHub | |
uses: docker/login-action@v3 | |
with: | |
username: zorgbort | |
password: ${{ secrets.ZORGBORT_DOCKER_TOKEN }} | |
- name: Deploy to Docker Registry | |
uses: docker/build-push-action@v5 | |
with: | |
context: . | |
tags: ilios/${{ matrix.image }}:${{needs.tags.outputs.major}},ilios/${{ matrix.image }}:${{needs.tags.outputs.minor}},ilios/${{ matrix.image }}:${{needs.tags.outputs.patch}} | |
build-args: ILIOS_VERSION=${{needs.tags.outputs.patch}} | |
target: ${{ matrix.image }} | |
push: true | |
provenance: false #https://github.com/gabrieldemarmiesse/python-on-whales/issues/407 | |
platforms: linux/amd64,linux/arm64 | |
- uses: act10ns/[email protected] | |
with: | |
status: ${{ job.status }} | |
message: Failed to deploy {{ env.GITHUB_SERVER_URL }}/{{ env.GITHUB_REPOSITORY }}/actions/runs/{{ env.GITHUB_RUN_ID }} | |
if: failure() |