|
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 |
3 | 2 |
|
4 | 3 | on: |
5 | | - # Runs on pushes targeting the default branch |
6 | 4 | push: |
7 | | - branches: ["main"] |
| 5 | + branches: |
| 6 | + - main |
| 7 | + pull_request: |
| 8 | + branches: |
| 9 | + - main |
8 | 10 |
|
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 |
13 | 11 | permissions: |
14 | 12 | contents: read |
15 | | - pages: write |
16 | 13 | 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 |
23 | 15 |
|
24 | 16 | jobs: |
25 | | - # Build job |
26 | 17 | build: |
27 | 18 | runs-on: ubuntu-latest |
| 19 | + |
28 | 20 | steps: |
29 | | - - name: Checkout |
| 21 | + - name: Checkout code |
30 | 22 | 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 |
35 | 26 | 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 |
0 commit comments