|
1 |
| -name: CI for GitHub Pages site |
| 1 | +name: Deploy Jekyll site to Pages |
2 | 2 |
|
3 |
| -on: [push] |
| 3 | +on: |
| 4 | + # Runs on pushes targeting the default branch |
| 5 | + push: |
| 6 | + branches: ["main"] |
| 7 | + |
| 8 | + # Allows us to run this workflow manually from the Actions tab |
| 9 | + workflow_dispatch: |
| 10 | + |
| 11 | +# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages |
| 12 | +permissions: |
| 13 | + contents: read |
| 14 | + pages: write |
| 15 | + id-token: write |
| 16 | + |
| 17 | +# Allow one concurrent deployment |
| 18 | +concurrency: |
| 19 | + group: "pages" |
| 20 | + cancel-in-progress: true |
4 | 21 |
|
5 | 22 | jobs:
|
| 23 | + # Build job |
6 | 24 | build:
|
7 |
| - |
8 | 25 | runs-on: ubuntu-latest
|
9 |
| - |
10 | 26 | steps:
|
11 |
| - - uses: actions/checkout@v3 |
12 |
| - |
13 |
| - - uses: actions/setup-node@v3 |
| 27 | + - name: Checkout |
| 28 | + uses: actions/checkout@v3 |
| 29 | + - name: Set up Node |
| 30 | + uses: actions/setup-node@v3 |
14 | 31 | with:
|
15 | 32 | node-version: 16
|
16 | 33 | cache: 'npm'
|
17 | 34 | - name: Install node modules
|
18 | 35 | run: npm install
|
19 |
| - |
20 | 36 | - name: Set up Ruby
|
21 | 37 | uses: ruby/setup-ruby@ece82769428359c077b5a5eaff268902a303c101
|
22 | 38 | with:
|
23 |
| - ruby-version: '3.0' |
| 39 | + ruby-version: '3.1' |
24 | 40 | bundler-cache: true # runs 'bundle install' and caches installed gems automatically
|
25 |
| - |
26 |
| - - name: Build and test with Rake |
27 |
| - run: bundle exec rake |
28 |
| - |
29 |
| - - name: Build the site in the jekyll/builder container |
30 |
| - run: | |
31 |
| - docker run \ |
32 |
| - -v ${{ github.workspace }}:/srv/jekyll -v ${{ github.workspace }}/_site:/srv/jekyll/_site \ |
33 |
| - jekyll/builder:latest /bin/bash -c "chmod a+w /srv/jekyll/Gemfile.lock && chmod 777 /srv/jekyll && jekyll build --future" |
| 41 | + - name: Set up Pages |
| 42 | + id: pages |
| 43 | + uses: actions/configure-pages@v2 |
| 44 | + - name: Build with Jekyll |
| 45 | + # Outputs to the './_site' directory by default |
| 46 | + run: bundle exec jekyll build --baseurl "${{ steps.pages.outputs.base_path }}" |
| 47 | + env: |
| 48 | + JEKYLL_ENV: production |
| 49 | + - name: Upload artifact |
| 50 | + # Automatically uploads an artifact from the './_site' directory by default |
| 51 | + uses: actions/upload-pages-artifact@v1 |
| 52 | + |
| 53 | + # Deployment job |
| 54 | + deploy: |
| 55 | + environment: |
| 56 | + name: github-pages |
| 57 | + url: ${{ steps.deployment.outputs.page_url }} |
| 58 | + runs-on: ubuntu-latest |
| 59 | + needs: build |
| 60 | + steps: |
| 61 | + - name: Deploy to GitHub Pages |
| 62 | + id: deployment |
| 63 | + uses: actions/deploy-pages@v1 |
0 commit comments