-
-
Notifications
You must be signed in to change notification settings - Fork 171
44 lines (40 loc) · 1.2 KB
/
service_deploy-static-site.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
39
40
41
42
43
44
on:
workflow_call:
inputs:
environment-name:
required: true
type: string
jobs:
deploy-static-site:
runs-on: ubuntu-latest
permissions:
contents: read
deployments: write
environment:
name: ${{ inputs.environment-name }}
steps:
- uses: actions/checkout@v4
- name: Set env file
run: |
if [[ -z "$BASE_64_SECRET" ]]; then
echo '🚨🚨🚨 ENV File not set 🚨🚨🚨' 1>&2
exit 1
fi
echo $BASE_64_SECRET | base64 -d > .env
working-directory: ./docs
env:
BASE_64_SECRET: ${{ secrets.ENV_FILE_BASE64 }}
- run: |
yarn install --frozen-lockfile
yarn build
npx nuxi generate
working-directory: ./docs
- name: Publish to Cloudflare Pages
uses: cloudflare/pages-action@v1
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
projectName: site-financial-freedom
directory: docs/.output/public
branch: ${{ github.head_ref || github.ref_name }}
gitHubToken: ${{ secrets.GITHUB_TOKEN }}