forked from ilios/ilios
-
Notifications
You must be signed in to change notification settings - Fork 0
87 lines (85 loc) · 2.99 KB
/
deploy-nightly.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
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()