-
Notifications
You must be signed in to change notification settings - Fork 60
49 lines (47 loc) · 1.74 KB
/
update-compose.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
on:
pull_request:
workflow_call:
inputs:
pr_head:
type: string
name: Update docker-compose.yml docker-compose-dev.yml
permissions:
contents: write
jobs:
update_compose_files:
name: build files
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v4
with:
ref: "${{ github.event.pull_request.head.ref }}${{ inputs.pr_head }}"
- name: setup python
uses: actions/setup-python@v5
with:
python-version: 3.9
- name: install jinja2
run: |
pip3 install --user --upgrade j2cli
j2 --version
- name: build docker-compose.yml & docker-compose-dev.yml & docker-compose.zitadel.yml
run: |
j2 ./templates/docker-compose.j2 versions-config.json --format=json > ./docker-compose.yml
DEV_MODE=true j2 ./templates/docker-compose.j2 versions-config.json --format=json > ./docker-compose-dev.yml
j2 ./templates/docker-compose.zitadel.j2 versions-config.json --format=json > ./docker-compose.zitadel.yml
- name: run docker-compose.yml
run: docker compose -f ./docker-compose.yml up -d
- name: stop docker-compose.yml
run: docker compose -f ./docker-compose.yml down
- name: Initialize mandatory git config
run: |
git config user.name "GitHub Actions"
git config user.email [email protected]
- name: Commit compose files
id: make-commit
run: |
git add docker-compose.yml docker-compose-dev.yml docker-compose.zitadel.yml
if ! git diff-index --quiet HEAD; then
git commit --message "update docker-compose.yml docker-compose-dev.yml"
git push
fi