|
1 | | - |
2 | 1 | # This workflow uses actions that are not certified by GitHub. |
3 | 2 | # They are provided by a third-party and are governed by |
4 | 3 | # separate terms of service, privacy policy, and support |
5 | 4 | # documentation. |
6 | 5 | # This workflow will download a prebuilt Ruby version, install dependencies and run tests with Rake |
7 | 6 | # For more information see: https://github.com/marketplace/actions/setup-ruby-jruby-and-truffleruby |
8 | 7 |
|
| 8 | + |
9 | 9 | name: Lab design website deploy handler |
10 | 10 |
|
11 | 11 | on: |
12 | 12 | push: |
13 | | - branches: [ master ] |
| 13 | + branches: [master] |
14 | 14 |
|
15 | 15 | jobs: |
16 | 16 | build: |
17 | | - name: Build + Publish |
18 | 17 | runs-on: ubuntu-latest |
19 | | - |
| 18 | + |
20 | 19 | steps: |
21 | 20 | - uses: actions/checkout@v2 |
| 21 | + |
| 22 | + - name: Set up Ruby |
| 23 | + uses: ruby/setup-ruby@v1 |
22 | 24 | with: |
23 | | - persist-credentials: false |
24 | | - fetch-depth: 0 |
25 | | - - name: Set up Ruby 2.6 |
26 | | - uses: actions/setup-ruby@v1 |
27 | | - with: |
28 | | - ruby-version: 2.6.x |
| 25 | + ruby-version: '3.1' |
29 | 26 |
|
30 | | - - name: Build Jekyll site |
| 27 | + - name: Install dependencies |
31 | 28 | run: | |
32 | | - set -xo pipefail |
33 | | - rm -rf _site/* |
34 | 29 | gem install bundler |
35 | 30 | bundle install |
36 | | - bundle exec jekyll build |
37 | | - cp CNAME _site/CNAME |
38 | | - |
39 | | - - name: Commit files |
40 | | - env: |
41 | | - GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} |
42 | | - run: | |
43 | | - set -xo pipefail |
44 | | - git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com" |
45 | | - git config --local user.name "github-actions[bot]" |
46 | | - git checkout master |
47 | | - ls -Q | grep -v _site | xargs rm -rf |
48 | | - mv _site/* . |
49 | | - rm -rf _site |
50 | | - [[ -n "$(git status --porcelain)" ]] || exit 0 |
51 | | - git add . |
52 | | - git commit -m "Build $(git rev-parse source | grep -o '^.\{10\}')" |
53 | | - - name: Push changes |
54 | | - uses: ad-m/github-push-action@master |
| 31 | +
|
| 32 | + - name: Build the site |
| 33 | + run: bundle exec jekyll build |
| 34 | + |
| 35 | + - name: Deploy to GitHub Pages |
| 36 | + uses: peaceiris/actions-gh-pages@v3 |
55 | 37 | with: |
56 | 38 | github_token: ${{ secrets.GITHUB_TOKEN }} |
57 | | - branch: ${{ github.ref }} |
58 | | - force: true |
| 39 | + publish_dir: ./_site |
| 40 | + enable_jekyll: true |
| 41 | + cname: lab-design.github.io |
0 commit comments