|
| 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: |
| 10 | + push: |
| 11 | + branches: ["main"] |
| 12 | + paths: |
| 13 | + - "docs/**" |
| 14 | + |
| 15 | + # Allows you to run this workflow manually from the Actions tab |
| 16 | + workflow_dispatch: |
| 17 | + |
| 18 | +# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages |
| 19 | +permissions: |
| 20 | + contents: read |
| 21 | + pages: write |
| 22 | + id-token: write |
| 23 | + |
| 24 | +# Allow one concurrent deployment |
| 25 | +concurrency: |
| 26 | + group: "pages" |
| 27 | + cancel-in-progress: true |
| 28 | + |
| 29 | +jobs: |
| 30 | + # Build job |
| 31 | + build: |
| 32 | + runs-on: ubuntu-latest |
| 33 | + defaults: |
| 34 | + run: |
| 35 | + working-directory: docs |
| 36 | + steps: |
| 37 | + - name: Checkout |
| 38 | + uses: actions/checkout@v3 |
| 39 | + - name: Setup Ruby |
| 40 | + uses: ruby/setup-ruby@v1 |
| 41 | + with: |
| 42 | + ruby-version: '3.1' # Not needed with a .ruby-version file |
| 43 | + bundler-cache: true # runs 'bundle install' and caches installed gems automatically |
| 44 | + cache-version: 0 # Increment this number if you need to re-download cached gems |
| 45 | + working-directory: '${{ github.workspace }}/docs' |
| 46 | + - name: Setup Pages |
| 47 | + id: pages |
| 48 | + uses: actions/configure-pages@v3 |
| 49 | + - name: Build with Jekyll |
| 50 | + # Outputs to the './_site' directory by default |
| 51 | + run: bundle exec jekyll build --baseurl "${{ steps.pages.outputs.base_path }}" |
| 52 | + env: |
| 53 | + JEKYLL_ENV: production |
| 54 | + - name: Upload artifact |
| 55 | + # Automatically uploads an artifact from the './_site' directory by default |
| 56 | + uses: actions/upload-pages-artifact@v1 |
| 57 | + with: |
| 58 | + path: "docs/_site/" |
| 59 | + # Deployment job |
| 60 | + deploy: |
| 61 | + environment: |
| 62 | + name: github-pages |
| 63 | + url: ${{ steps.deployment.outputs.page_url }} |
| 64 | + runs-on: ubuntu-latest |
| 65 | + needs: build |
| 66 | + steps: |
| 67 | + - name: Deploy to GitHub Pages |
| 68 | + id: deployment |
| 69 | + uses: actions/deploy-pages@v2 |
0 commit comments