Merge pull request #276 from beawitcht/development #173
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }} |