-
Notifications
You must be signed in to change notification settings - Fork 1
132 lines (119 loc) · 5.15 KB
/
podman.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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
name: Podman build & deploy
on:
push:
branches:
- develop
workflow_dispatch:
# temporarily also for PRs
pull_request:
branches:
- develop
jobs:
deploy-test:
name: Deploy to test environment
environment: Test
runs-on: tst
if: github.ref == 'refs/heads/develop'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
env:
# Variables
AML_ALLOWED_HOSTS: ${{ vars.AML_ALLOWED_HOSTS }}
AML_CORS_ORIGIN_WHITELIST: ${{ vars.AML_CORS_ORIGIN_WHITELIST }}
AML_DEBUG: ${{ vars.AML_DEBUG }}
AML_LOCATION_PROVIDER: ${{ vars.AML_LOCATION_PROVIDER }}
AML_SUBPATH: ${{ vars.AML_SUBPATH }}
DJANGO_SETTINGS_MODULE: ${{ vars.DJANGO_SETTINGS_MODULE }}
SQL_DATABASE: ${{ vars.SQL_DATABASE }}
SQL_HOST: ${{ vars.SQL_HOST }}
SQL_PORT: ${{ vars.SQL_PORT }}
REACT_APP_API_ROOT: ${{ vars.REACT_APP_API_ROOT }}
REACT_APP_EXPERIMENT_SLUG: ${{ vars.REACT_APP_EXPERIMENT_SLUG }}
REACT_APP_AML_HOME: ${{ vars.REACT_APP_AML_HOME }}
REACT_APP_HTML_PAGE_TITLE: ${{ vars.REACT_APP_HTML_PAGE_TITLE }}
# Secrets
AML_SECRET_KEY: ${{ secrets.AML_SECRET_KEY }}
SENTRY_DSN: ${{ secrets.SENTRY_DSN }}
SQL_USER: ${{ secrets.SQL_USER }}
SQL_PASSWORD: ${{ secrets.SQL_PASSWORD }}
REACT_APP_SENTRY_DSN: ${{ secrets.REACT_APP_SENTRY_DSN }}
DJANGO_SUPERUSER_USERNAME: ${{ secrets.DJANGO_SUPERUSER_USERNAME }}
DJANGO_SUPERUSER_PASSWORD: ${{ secrets.DJANGO_SUPERUSER_PASSWORD }}
DJANGO_SUPERUSER_EMAIL: ${{ secrets.DJANGO_SUPERUSER_EMAIL }}
# Prevent podman services from exiting after startup
RUNNER_TRACKING_ID: ""
steps:
- uses: actions/checkout@v4
- name: Create .env file
run: |
touch .env
echo "REACT_APP_API_ROOT=$REACT_APP_API_ROOT" >> .env
echo "REACT_APP_EXPERIMENT_SLUG=$REACT_APP_EXPERIMENT_SLUG" >> .env
echo "REACT_APP_AML_HOME=$REACT_APP_AML_HOME" >> .env
echo "REACT_APP_HTML_PAGE_TITLE=$REACT_APP_HTML_PAGE_TITLE" >> .env
echo "REACT_APP_SENTRY_DSN=$REACT_APP_SENTRY_DSN" >> .env
cp .env frontend/.env
- name: Build Podman images
run: podman-compose -f docker-compose-deploy.yml build
- name: Deploy Podman images
run: podman-compose -f docker-compose-deploy.yml up -d --force-recreate
- name: Prune old images
run: podman image prune -a -f
- name: Check Podman images
run: podman-compose -f docker-compose-deploy.yml ps
- name: Check logs
run: podman-compose -f docker-compose-deploy.yml logs
deploy-acceptance:
name: Deploy to acceptance environment
environment: Acceptance
runs-on: ACC
if: github.ref == 'refs/heads/main' || github.ref == 'refs/tags/*' || 1 == 1 # Temporarily always run during testing
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
env:
# Variables
AML_ALLOWED_HOSTS: ${{ vars.AML_ALLOWED_HOSTS }}
AML_CORS_ORIGIN_WHITELIST: ${{ vars.AML_CORS_ORIGIN_WHITELIST }}
AML_DEBUG: ${{ vars.AML_DEBUG }}
AML_LOCATION_PROVIDER: ${{ vars.AML_LOCATION_PROVIDER }}
AML_SUBPATH: ${{ vars.AML_SUBPATH }}
DJANGO_SETTINGS_MODULE: ${{ vars.DJANGO_SETTINGS_MODULE }}
SQL_DATABASE: ${{ vars.SQL_DATABASE }}
SQL_HOST: ${{ vars.SQL_HOST }}
SQL_PORT: ${{ vars.SQL_PORT }}
REACT_APP_API_ROOT: ${{ vars.REACT_APP_API_ROOT }}
REACT_APP_EXPERIMENT_SLUG: ${{ vars.REACT_APP_EXPERIMENT_SLUG }}
REACT_APP_AML_HOME: ${{ vars.REACT_APP_AML_HOME }}
REACT_APP_HTML_PAGE_TITLE: ${{ vars.REACT_APP_HTML_PAGE_TITLE }}
# Secrets
AML_SECRET_KEY: ${{ secrets.AML_SECRET_KEY }}
SENTRY_DSN: ${{ secrets.SENTRY_DSN }}
SQL_USER: ${{ secrets.SQL_USER }}
SQL_PASSWORD: ${{ secrets.SQL_PASSWORD }}
REACT_APP_SENTRY_DSN: ${{ secrets.REACT_APP_SENTRY_DSN }}
DJANGO_SUPERUSER_USERNAME: ${{ secrets.DJANGO_SUPERUSER_USERNAME }}
DJANGO_SUPERUSER_PASSWORD: ${{ secrets.DJANGO_SUPERUSER_PASSWORD }}
DJANGO_SUPERUSER_EMAIL: ${{ secrets.DJANGO_SUPERUSER_EMAIL }}
# Prevent podman services from exiting after startup
RUNNER_TRACKING_ID: ""
steps:
- uses: actions/checkout@v4
- name: Create .env file
run: |
touch .env
echo "REACT_APP_API_ROOT=$REACT_APP_API_ROOT" >> .env
echo "REACT_APP_EXPERIMENT_SLUG=$REACT_APP_EXPERIMENT_SLUG" >> .env
echo "REACT_APP_AML_HOME=$REACT_APP_AML_HOME" >> .env
echo "REACT_APP_HTML_PAGE_TITLE=$REACT_APP_HTML_PAGE_TITLE" >> .env
echo "REACT_APP_SENTRY_DSN=$REACT_APP_SENTRY_DSN" >> .env
cp .env frontend/.env
- name: Build Podman images
run: podman-compose -f docker-compose-deploy.yml build
- name: Deploy Podman images
run: podman-compose -f docker-compose-deploy.yml up -d --force-recreate
- name: Prune old images
run: podman image prune -a -f
- name: Check Podman images
run: podman-compose -f docker-compose-deploy.yml ps
- name: Check logs
run: podman-compose -f docker-compose-deploy.yml logs