Interview with msub2 #518
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: build-pr | |
on: | |
pull_request: | |
branches: | |
- main | |
env: | |
HEAD_REF: ${{ github.head_ref }} | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
steps: | |
- name: Setup Node | |
uses: actions/setup-node@v1 | |
with: | |
node-version: '16.x' | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Cache Node modules | |
uses: actions/cache@v2 | |
with: | |
path: ~/.npm | |
key: npm-${{ runner.os }}-${{ hashFiles('package-lock.json') }} | |
restore-keys: | | |
npm-${{ runner.os }}- | |
npm- | |
- name: Install Node modules | |
run: npm install | |
- name: Sass | |
run: npm run sass | |
- name: Sass Reveal.js | |
run: npm run sass-revealjs | |
- name: Eleventy | |
run: | | |
npx eleventy \ | |
--output='_site/${{ env.HEAD_REF }}' \ | |
--pathprefix='/${{ env.HEAD_REF }}/' | |
LC_TIME=C date > '_site/${{ env.HEAD_REF }}/.stamp' | |
- name: Deploy | |
uses: peaceiris/actions-gh-pages@v3 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: ./_site | |
keep_files: true | |
- name: Deploy link | |
run: | | |
echo "Preview link: https://servo.org/${{ env.HEAD_REF }}/" >> $GITHUB_STEP_SUMMARY | |
add_preview_link: | |
runs-on: ubuntu-latest | |
name: Comment preview link in the PR | |
needs: build | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Comment PR | |
uses: thollander/actions-comment-pull-request@v2 | |
with: | |
message: | | |
Preview link: https://servo.org/${{ env.HEAD_REF }}/ |