|
| 1 | +# Combination of |
| 2 | +# https://gist.github.com/elstudio/38bacfe7aab63da082a418fd3a1ddb66 |
| 3 | +# https://github.com/actions/starter-workflows/blob/3e10d18ba714b1c612e15b635b298a6283000c4b/pages/jekyll.yml |
| 4 | + |
| 5 | +name: Deploy Jekyll site to Pages |
| 6 | + |
| 7 | +on: |
| 8 | + # Runs on pushes targeting the default branch |
| 9 | + push: |
| 10 | + branches: [$default-branch, resize-images] |
| 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 one concurrent deployment |
| 19 | +concurrency: |
| 20 | + group: "pages" |
| 21 | + cancel-in-progress: true |
| 22 | + |
| 23 | +jobs: |
| 24 | + # Build job |
| 25 | + build: |
| 26 | + runs-on: ubuntu-latest |
| 27 | + steps: |
| 28 | + # Jekyll Picture Tag requires libvips libraries for resizing images, which must be installed |
| 29 | + - name: Install JPT's dependencies |
| 30 | + run: sudo apt-get install libvips-tools |
| 31 | + - name: Checkout |
| 32 | + uses: actions/checkout@v3 |
| 33 | + - name: Setup Ruby |
| 34 | + uses: ruby/setup-ruby@v1 |
| 35 | + with: |
| 36 | + ruby-version: '3.1' # Not needed with a .ruby-version file |
| 37 | + bundler-cache: true # runs 'bundle install' and caches installed gems automatically |
| 38 | + cache-version: 0 # Increment this number if you need to re-download cached gems |
| 39 | + - name: Setup Pages |
| 40 | + id: pages |
| 41 | + uses: actions/configure-pages@v2 |
| 42 | + - name: Build with Jekyll |
| 43 | + # Outputs to the './_site' directory by default |
| 44 | + run: bundle exec jekyll build --baseurl "${{ steps.pages.outputs.base_path }}" |
| 45 | + env: |
| 46 | + JEKYLL_ENV: production |
| 47 | + - name: Upload artifact |
| 48 | + # Automatically uploads an artifact from the './_site' directory by default |
| 49 | + uses: actions/upload-pages-artifact@v1 |
| 50 | + |
| 51 | + # Deployment job |
| 52 | + deploy: |
| 53 | + environment: |
| 54 | + name: github-pages |
| 55 | + url: ${{ steps.deployment.outputs.page_url }} |
| 56 | + runs-on: ubuntu-latest |
| 57 | + needs: build |
| 58 | + steps: |
| 59 | + - name: Deploy to GitHub Pages |
| 60 | + id: deployment |
| 61 | + uses: actions/deploy-pages@v1 |
0 commit comments