-
-
Notifications
You must be signed in to change notification settings - Fork 2
38 lines (36 loc) · 1 KB
/
prod-ci.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
name: Push to prod
on:
push:
branches:
- main
paths:
- 'app/**'
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: pulling image via SSH
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.SSH_HOST }}
username: ${{ secrets.SSH_USERNAME }}
key: ${{ secrets.SSH_KEY }}
script: |
cd mysite
git reset --hard HEAD
git pull https://github.com/beawitcht/transinformed-server main
pip3 install -r app/requirements.txt
touch ${{ secrets.TOUCH_PATH }}
rm -f app/tmp/cache/*
- name: purge cache
id: cfPurge
uses: fjogeleit/http-request-action@v1
with:
url: ${{ secrets.CF_API_URL }}
method: 'POST'
data: "{\"purge_everything\": true}"
customHeaders: "{\"Authorization\": \"Bearer ${{ secrets.CF_API_KEY }}\"}"
- name: Response status
run: |
echo ${{ fromJson(steps.cfPurge.outputs.response).success }}