Deploy to Cloudflare Pages #128
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 to Cloudflare Pages | |
on: | |
push: | |
branches: [main] | |
schedule: | |
- cron: '0 17 * * *' # <- 4:00 AM AEDT | |
workflow_dispatch: | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
environment: production | |
timeout-minutes: 60 | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v4 | |
- name: Install git-crypt | |
run: | | |
sudo apt-get -y update | |
sudo apt-get -y install git-crypt | |
- name: Decrypt files with git-crypt | |
env: | |
GIT_CRYPT_KEY_B64: ${{ secrets.GIT_CRYPT_KEY_B64 }} | |
run: | | |
echo "$GIT_CRYPT_KEY_B64" | base64 -d > git-crypt.key | |
git-crypt unlock git-crypt.key | |
- name: Install, build, and upload your site output | |
uses: withastro/action@v1 | |
with: | |
node-version: 20 | |
package-manager: pnpm@latest | |
- name: Cache NPM dependencies | |
uses: actions/cache@v2 | |
with: | |
path: ~/.local/share/pnpm/store | |
key: ${{ runner.os }}-pnpm-cache-${{ hashFiles('**/package-lock.json') }} | |
restore-keys: | | |
${{ runner.os }}-pnpm-cache- | |
- name: Deploy to Cloudflare Pages | |
uses: cloudflare/pages-action@v1.5.0 | |
with: | |
apiToken: ${{ secrets.CF_API_TOKEN }} | |
accountId: ${{ secrets.CF_ACCOUNT_ID }} | |
projectName: hedior-cv | |
directory: ./dist |