Skip to content

Commit

Permalink
Github Action to build-publish to cloudflare
Browse files Browse the repository at this point in the history
  • Loading branch information
davidcollom committed May 29, 2024
1 parent a3f211b commit 09a50f4
Showing 1 changed file with 51 additions and 0 deletions.
51 changes: 51 additions & 0 deletions .github/workflows/build-deploy.yaml
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'

0 comments on commit 09a50f4

Please sign in to comment.