enable repo on posts #1072
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: Deploy | |
concurrency: | |
cancel-in-progress: true | |
group: staging # TODO stage/prod separate | |
on: | |
push: | |
jobs: | |
Build: | |
uses: ./.github/workflows/build.yml | |
with: | |
hugo_env: staging # TODO stage/prod | |
Deploy: | |
runs-on: ubuntu-latest | |
environment: staging # TODO stage/prod | |
needs: Build | |
steps: | |
- name: Download HTML | |
uses: actions/download-artifact@v3 | |
with: | |
name: html | |
path: html | |
- name: Setup SSH | |
uses: shimataro/ssh-key-action@v2 | |
with: | |
key: "${{ secrets.SSH_PRIVATE_KEY }}" | |
known_hosts: "${{ vars.SSH_KNOWN_HOSTS }}" | |
- name: Rsync | |
env: | |
SSH_HOST: "${{ vars.SSH_HOST }}" | |
SSH_USER: "${{ secrets.SSH_USER }}" | |
run: rsync -rptcivh --delete-after --stats ./html/ "$SSH_USER@$SSH_HOST:/home/public" | |
- name: Purge Cloudflare Cache | |
env: | |
CF_AUTH: "Authorization: Bearer ${{ secrets.CF_API_TOKEN }}" | |
CF_URL: "https://api.cloudflare.com/client/v4/zones/${{ secrets.CF_ZONE_ID }}/purge_cache" | |
run: curl -f "$CF_URL" -H "$CF_AUTH" --data '{"purge_everything":true}' |