-
Notifications
You must be signed in to change notification settings - Fork 40
61 lines (59 loc) · 1.84 KB
/
deploy-pr.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
name: Deploy Pull Request
on:
pull_request_target:
types: [labeled]
jobs:
deploy-docker-containers:
name: Deploy Docker (preview-pr-${{github.event.number}})
if: contains(github.event.pull_request.labels.*.name, 'safe to deploy')
runs-on: ubuntu-latest
strategy:
matrix:
image:
- php-apache
- nginx
- fpm
- fpm-dev
- admin
- update-frontend
- consume-messages
- mysql
- mysql-demo
- opensearch
- redis
steps:
- 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: ${{ matrix.image }} (preview-pr-${{github.event.number}})
uses: docker/build-push-action@v5
with:
tags: |
ilios/${{ matrix.image }}:preview-pr-${{github.event.number}}
target: ${{ matrix.image }}
push: true
provenance: false #https://github.com/gabrieldemarmiesse/python-on-whales/issues/407
platforms: linux/amd64,linux/arm64
comment:
runs-on: ubuntu-latest
needs: deploy-docker-containers
steps:
- uses: actions/github-script@v7
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: "PR deployed to docker for all containers, you can access with the tag `preview-pr-${{github.event.number}}`"
})