Skip to content

Commit

Permalink
update actions to use cf pages directly
Browse files Browse the repository at this point in the history
  • Loading branch information
lamalex committed Jan 14, 2024
1 parent a226ee6 commit df22ce1
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 26 deletions.
27 changes: 1 addition & 26 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,38 +1,13 @@
name: GitHub Pages CI
on: [pull_request, push]

jobs:
verify:
runs-on: ubuntu-20.04
if: ${{ github.ref != 'refs/heads/master' }}
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install Zola
run: sudo snap install --edge zola
- name: Verify build/links
run: zola check

build_and_deploy:
name: Build site with Zola and deploy
runs-on: ubuntu-latest
if: ${{ github.ref == 'refs/heads/main' }}
needs: verify
steps:
- uses: actions/checkout@master
- name: Install Zola
run: sudo snap install --edge zola
- name: Build PDF CV
run: |
zola serve &
export ZOLA_PID=$!
sleep 5
curl localhost:1111/cv &> /dev/null
google-chrome --headless --run-all-compositor-stages-before-draw --print-to-pdf-no-header --print-to-pdf=static/alexlauni-resume.pdf http://localhost:1111/cv
kill $ZOLA_PID
- name: Build site
run: zola build
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./public
37 changes: 37 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
on: [push]

jobs:
publish:
runs-on: ubuntu-latest
permissions:
contents: read
deployments: write
name: Publish to Cloudflare Pages
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Install Zola
run: sudo snap install --edge zola

- name: Build PDF CV
run: |
zola serve &
export ZOLA_PID=$!
sleep 5
curl localhost:1111/cv &> /dev/null
google-chrome --headless --run-all-compositor-stages-before-draw --print-to-pdf-no-header --print-to-pdf=static/alexlauni-resume.pdf http://localhost:1111/cv
kill $ZOLA_PID
- name: Build site
run: zola build

- name: Publish to Cloudflare Pages
uses: cloudflare/pages-action@v1
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: bde07ad246cac0ae6ae68324e6aae341
projectName: lamalex-github-io
directory: public
gitHubToken: ${{ secrets.GITHUB_TOKEN }}
wranglerVersion: '3'

0 comments on commit df22ce1

Please sign in to comment.