|
1 | | -name: Build |
2 | | -on: |
3 | | - pull_request: |
4 | | - push: |
5 | | - branches: |
6 | | - - master |
| 1 | +# This workflow uses actions that are not certified by GitHub. |
| 2 | +# They are provided by a third-party and are governed by |
| 3 | +# separate terms of service, privacy policy, and support |
| 4 | +# documentation. |
| 5 | + |
| 6 | +# Sample workflow for building and deploying a Jekyll site to GitHub Pages |
| 7 | +name: Deploy Jekyll site to Pages |
| 8 | + |
| 9 | +on: [push, 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 only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. |
| 18 | +# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. |
| 19 | +concurrency: |
| 20 | + group: "pages" |
| 21 | + cancel-in-progress: false |
7 | 22 |
|
8 | 23 | jobs: |
| 24 | + # Build job |
9 | 25 | build: |
10 | | - name: Build |
11 | | - runs-on: ubuntu-22.04 |
| 26 | + runs-on: ubuntu-latest |
12 | 27 | steps: |
13 | | - - uses: actions/checkout@24cb9080177205b6e8c946b17badbe402adc938f # v3.4.0 |
14 | | - - uses: ruby/setup-ruby@ec02537da5712d66d4d50a0f33b7eb52773b5ed1 # v1.144.2 |
| 28 | + - name: Checkout |
| 29 | + uses: actions/checkout@v4 |
| 30 | + - name: Setup Ruby |
| 31 | + uses: ruby/setup-ruby@v1 |
15 | 32 | with: |
16 | | - bundler-cache: true |
17 | | - ruby-version: 3.0.5 |
18 | | - - name: Build |
19 | | - run: bundle exec jekyll build |
| 33 | + bundler-cache: true # runs 'bundle install' and caches installed gems automatically |
| 34 | + cache-version: 1 # Increment this number if you need to re-download cached gems |
| 35 | + - name: Setup Pages |
| 36 | + id: pages |
| 37 | + uses: actions/configure-pages@v5 |
| 38 | + - name: Build with Jekyll |
| 39 | + # Outputs to the './_site' directory by default |
| 40 | + run: bundle exec jekyll build --baseurl "${{ steps.pages.outputs.base_path }}" |
| 41 | + env: |
| 42 | + JEKYLL_ENV: production |
| 43 | + - name: Upload artifact |
| 44 | + # Automatically uploads an artifact from the './_site' directory by default |
| 45 | + uses: actions/upload-pages-artifact@v3 |
| 46 | + |
| 47 | + # Deployment job |
| 48 | + deploy: |
| 49 | + environment: |
| 50 | + name: github-pages |
| 51 | + url: ${{ steps.deployment.outputs.page_url }} |
| 52 | + runs-on: ubuntu-latest |
| 53 | + needs: build |
| 54 | + if: github.ref == 'refs/heads/master' |
| 55 | + steps: |
| 56 | + - name: Deploy to GitHub Pages |
| 57 | + id: deployment |
| 58 | + uses: actions/deploy-pages@v4 |
0 commit comments