-
Notifications
You must be signed in to change notification settings - Fork 27
31 lines (29 loc) · 1.16 KB
/
certbot-update-cert.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
name: Update TLS certificates for vscale
on:
schedule:
- cron: '0 0 15 * *'
jobs:
update_certs:
runs-on: vscale
steps:
- uses: actions/checkout@v3
- name: Configure secrets
run: |
echo "$S3_KEY"|base64 -d > aws-key.properties
mv docker-compose-run.yml docker-compose.yml
sed -i -e "s/_YANDEX_AUTH_TOKEN_/\\$YANDEX_AUTH_TOKEN/" docker-compose.yml
sed -i -e "s/_YANDEX_FOLDER_ID_/\\$YANDEX_FOLDER_ID/" docker-compose.yml
sed -i -e "s/_POSTGRES_PASSWORD_/\\$POSTGRES_PASSWORD/" docker-compose.yml
sed -i -e "s/_API_GITHUB_TOKEN_/\\$API_GITHUB_TOKEN/" docker-compose.yml
env:
S3_KEY: ${{ secrets.S3_KEY }}
YANDEX_AUTH_TOKEN: ${{ secrets.YANDEX_AUTH_TOKEN }}
YANDEX_FOLDER_ID: ${{ secrets.YANDEX_FOLDER_ID }}
POSTGRES_PASSWORD: ${{ secrets.POSTGRES_PASSWORD }}
API_GITHUB_TOKEN: ${{ secrets.API_GITHUB_TOKEN }}
- name: Update certs
run: |
docker-compose pull
docker-compose run --rm certbot renew --allow-subset-of-names
docker-compose restart brn_fe_with_tls
docker image prune -af