-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Github Action to build-publish to cloudflare
- Loading branch information
1 parent
a3f211b
commit 09a50f4
Showing
1 changed file
with
51 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
name: Build and Deploy | ||
on: | ||
workflow_dispatch: # Enable manual generation | ||
pull_request: | ||
push: | ||
branches: | ||
- "main" | ||
|
||
jobs: | ||
build_and_deploy_hugo_site: | ||
runs-on: ubuntu-latest | ||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
|
||
name: Build and Deploy Static site | ||
|
||
steps: | ||
- name: Checkout repo on source_branch | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: "0" | ||
|
||
- uses: actions/setup-python@v5 | ||
with: | ||
python-version: 3.x | ||
|
||
- uses: actions/cache@v4 | ||
with: | ||
key: mkdocs-material-${{ env.cache_id }} | ||
path: .cache | ||
restore-keys: | | ||
mkdocs-material- | ||
- name: Dependencies | ||
run: pip install -r requirements.txt | ||
|
||
- name: Build | ||
run: mkdocs build | ||
|
||
- name: Publish to Cloudflare Pages | ||
id: deploy | ||
uses: cloudflare/pages-action@v1 | ||
if: ${{ github.actor != 'dependabot[bot]' }} | ||
with: | ||
apiToken: ${{ secrets.CLOUDFLARE_API_KEY }} | ||
accountId: ${{secrets.CLOUDFLARE_ACCOUNT_ID}} | ||
projectName: ${{secrets.CLOUDFLARE_PROJECT_NAME}} | ||
directory: "./site/" | ||
gitHubToken: ${{ secrets.GITHUB_TOKEN }} | ||
wranglerVersion: '3' |