-
Notifications
You must be signed in to change notification settings - Fork 61
40 lines (38 loc) · 1.3 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
on:
pull_request:
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 }}
- 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
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
- name: Initialize mandatory git config
run: |
git config user.name "GitHub Actions"
git config user.email noreply@github.com
- name: Commit compose files
id: make-commit
run: |
git add docker-compose.yml docker-compose-dev.yml
if ! git diff-index --quiet HEAD; then
git commit --message "update docker-compose.yml docker-compose-dev.yml"
git push
fi