Skip to content

Build and Tag Nightly #576

Build and Tag Nightly

Build and Tag Nightly #576

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 "latestTag=${LATEST_TAG}" >> "$GITHUB_OUTPUT"
MAJOR_VERSION=$(echo $LATEST_TAG | sed -rn 's#^(v3)\.([0-9]+)\.([0-9]+)$#\1#p')
echo ${MAJOR_VERSION}
echo "major=${MAJOR_VERSION}" >> "$GITHUB_OUTPUT"
MINOR_VERSION=$(echo $LATEST_TAG | sed -rn 's#^(v3)\.([0-9]+)\.([0-9]+)$#\1.\2#p')
echo ${MINOR_VERSION}
echo "minor=${MINOR_VERSION}" >> "$GITHUB_OUTPUT"
PATCH_VERSION=$(echo $LATEST_TAG | sed -rn 's#^(v3)\.([0-9]+)\.([0-9]+)$#\1.\2.\3#p')
echo ${PATCH_VERSION}
echo "patch=${PATCH_VERSION}" >> "$GITHUB_OUTPUT"
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@v6
with:
context: .
tags: ilios/${{ matrix.image }}:${{needs.tags.outputs.major}},ilios/${{ matrix.image }}:${{needs.tags.outputs.minor}},ilios/${{ matrix.image }}:${{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()