|
| 1 | +# Sample workflow for building and deploying a Jekyll site to GitHub Pages |
| 2 | +name: Deploy Jekyll site to Pages |
| 3 | + |
| 4 | +on: |
| 5 | + # Runs on pushes targeting the default branch |
| 6 | + push: |
| 7 | + branches: master |
| 8 | + |
| 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 | +permissions: |
| 14 | + contents: read |
| 15 | + pages: write |
| 16 | + 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 |
| 23 | + |
1 | 24 | jobs: |
2 | 25 | # Build job |
3 | 26 | build: |
4 | | - # <Not provided for brevity> |
5 | | - # At a minimum this job should upload artifacts using actions/upload-pages-artifact |
6 | | - |
7 | | - # Deploy job |
8 | | - deploy: |
9 | | - # Add a dependency to the build job |
10 | | - needs: build |
| 27 | + runs-on: ubuntu-latest |
| 28 | + steps: |
| 29 | + - name: Checkout |
| 30 | + uses: actions/checkout@v3 |
| 31 | + with: |
| 32 | + submodules: "true" |
11 | 33 |
|
12 | | - # Grant GITHUB_TOKEN the permissions required to make a Pages deployment |
13 | | - permissions: |
14 | | - pages: write # to deploy to Pages |
15 | | - id-token: write # to verify the deployment originates from an appropriate source |
| 34 | + - name: Setup Ruby |
| 35 | + uses: ruby/setup-ruby@v1 |
| 36 | + with: |
| 37 | + ruby-version: "2.7" # Not needed with a .ruby-version file |
| 38 | + bundler-cache: true # runs 'bundle install' and caches installed gems automatically |
| 39 | + cache-version: 0 # Increment this number if you need to re-download cached gems |
| 40 | + - uses: MatteoH2O1999/setup-python@v2 |
| 41 | + with: |
| 42 | + python-version: "2.7" |
| 43 | + - name: Setup Pages |
| 44 | + id: pages |
| 45 | + uses: actions/configure-pages@v3 |
| 46 | + - name: Build with Jekyll |
| 47 | + run: bundle exec jekyll build |
| 48 | + env: |
| 49 | + JEKYLL_ENV: production |
| 50 | + - name: Upload artifact |
| 51 | + # Automatically uploads an artifact from the './_site' directory by default |
| 52 | + uses: actions/upload-pages-artifact@v3 |
16 | 53 |
|
17 | | - # Deploy to the github-pages environment |
| 54 | + # Deployment job |
| 55 | + deploy: |
18 | 56 | environment: |
19 | 57 | name: github-pages |
20 | 58 | url: ${{ steps.deployment.outputs.page_url }} |
21 | | - |
22 | | - # Specify runner + deployment step |
23 | 59 | runs-on: ubuntu-latest |
| 60 | + needs: build |
24 | 61 | steps: |
25 | 62 | - name: Deploy to GitHub Pages |
26 | 63 | id: deployment |
27 | | - uses: actions/deploy-pages@v4 # or specific "vX.X.X" version tag for this action |
| 64 | + uses: actions/deploy-pages@v4 |
0 commit comments