Skip to content

Commit 9c68b71

Browse files
committed
Refactor GitHub Actions workflow for Cloudflare Pages deployment and update Jekyll config includes
Signed-off-by: DavidOsipov <[email protected]>
1 parent aa65561 commit 9c68b71

File tree

2 files changed

+31
-38
lines changed

2 files changed

+31
-38
lines changed
Lines changed: 29 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,43 @@
1-
# Sample workflow for building and deploying a Jekyll site to GitHub Pages
2-
name: Deploy Jekyll with GitHub Pages dependencies preinstalled
1+
name: Build and Deploy to Cloudflare Pages
32

43
on:
5-
# Runs on pushes targeting the default branch
64
push:
7-
branches: ["main"]
5+
branches:
6+
- main
7+
pull_request:
8+
branches:
9+
- main
810

9-
# Allows you to run this workflow manually from the Actions tab
10-
workflow_dispatch:
11-
12-
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
1311
permissions:
1412
contents: read
15-
pages: write
1613
id-token: write
17-
18-
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
19-
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
20-
concurrency:
21-
group: "pages"
22-
cancel-in-progress: false
14+
deployments: write
2315

2416
jobs:
25-
# Build job
2617
build:
2718
runs-on: ubuntu-latest
19+
2820
steps:
29-
- name: Checkout
21+
- name: Checkout code
3022
uses: actions/checkout@v4
31-
- name: Setup Pages
32-
uses: actions/configure-pages@v5
33-
- name: Build with Jekyll
34-
uses: actions/jekyll-build-pages@v1
23+
24+
- name: Setup Ruby
25+
uses: ruby/setup-ruby@v1
3526
with:
36-
source: ./
37-
destination: ./_site
38-
config: _config.yml
39-
- name: Upload artifact
40-
uses: actions/upload-pages-artifact@v3
41-
42-
# Deployment job
43-
deploy:
44-
environment:
45-
name: github-pages
46-
url: ${{ steps.deployment.outputs.page_url }}
47-
runs-on: ubuntu-latest
48-
needs: build
49-
steps:
50-
- name: Deploy to GitHub Pages
51-
id: deployment
52-
uses: actions/deploy-pages@v4
27+
ruby-version: '3.0'
28+
29+
- name: Install dependencies
30+
run: |
31+
gem install bundler
32+
bundle install
33+
34+
- name: Build site
35+
run: |
36+
bundle exec jekyll build --destination .github/_site
37+
38+
- name: Deploy to Cloudflare Pages
39+
env:
40+
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_TOKEN }}
41+
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
42+
run: |
43+
npx wrangler pages deploy .github/_site --project-name="postquantum-feldman-vss" --branch=main

_config.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,11 @@ plugins:
1111
# Process these files as Jekyll files
1212
include:
1313
- "docs/"
14+
- "README.md"
1415
- "SECURITY.md"
1516
- "CODE_OF_CONDUCT.md"
1617
- "CONTRIBUTING.md"
18+
- "LICENSE"
1719

1820
# Relative links configuration
1921
relative_links:

0 commit comments

Comments
 (0)