Skip to content

Commit

Permalink
ci: update deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
flexiondotorg committed Nov 11, 2024
1 parent ac310af commit 8658191
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 17 deletions.
25 changes: 16 additions & 9 deletions .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ on:
push:
branches:
- main
schedule:
- cron: '47 * * * *' # “At minute 47.”
workflow_dispatch:

jobs:
Expand All @@ -17,28 +15,37 @@ jobs:
with:
submodules: false
fetch-depth: 0

- name: Install Hugo
uses: peaceiris/actions-hugo@v3
with:
hugo-version: '0.108.0'
extended: false

- name: Build Website
run: hugo --minify

- name: Deploy Website to GitHub Pages
uses: peaceiris/actions-gh-pages@v4
if: github.ref == 'refs/heads/main'
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./public

- name: Deploy Website to Server
uses: easingthemes/[email protected]
with:
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
ARGS: "-avizc --delete"
SOURCE: "./public/"
REMOTE_HOST: ${{ secrets.REMOTE_HOST }}
REMOTE_USER: ${{ secrets.REMOTE_USER }}
TARGET: ${{ secrets.REMOTE_TARGET }}
- name: Purge Cloudflare Cache
env:
CLOUDFLARE_ZONE_ID: ${{ secrets.CLOUDFLARE_ZONE_ID }}
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
chmod +x ./scripts/cloudflare_purge_cache.sh
./scripts/cloudflare_purge_cache.sh
curl \
--silent \
--request POST \
--header "Authorization: Bearer ${CLOUDFLARE_API_TOKEN}" \
--header "Content-Type: application/json" \
--data '{"purge_everything":true}' \
"https://api.cloudflare.com/client/v4/zones/${CLOUDFLARE_ZONE_ID}/purge_cache"
8 changes: 0 additions & 8 deletions scripts/cloudflare_purge_cache.sh

This file was deleted.

0 comments on commit 8658191

Please sign in to comment.