|
| 1 | +on: [pull_request] |
| 2 | + |
| 3 | +name: CI |
| 4 | + |
| 5 | +jobs: |
| 6 | + |
| 7 | + jekyll-latest: |
| 8 | + name: Build Jekyll site (latest) |
| 9 | + runs-on: ubuntu-latest |
| 10 | + steps: |
| 11 | + |
| 12 | + - uses: actions/checkout@master |
| 13 | + |
| 14 | + - name: Build the site in the jekyll/builder container |
| 15 | + run: | |
| 16 | + docker run --rm \ |
| 17 | + --volume="${{ github.workspace }}:/srv/jekyll" \ |
| 18 | + jekyll/builder:latest /bin/bash -c "gem install bundler && chmod -R 777 /srv/jekyll && jekyll build && bundle exec just-the-docs rake search:init" |
| 19 | +
|
| 20 | + jekyll-3-8-5: |
| 21 | + name: Build Jekyll site (v3.8.5) |
| 22 | + runs-on: ubuntu-latest |
| 23 | + steps: |
| 24 | + |
| 25 | + - uses: actions/checkout@master |
| 26 | + |
| 27 | + - name: Build the site in the jekyll/builder container |
| 28 | + run: | |
| 29 | + docker run --rm \ |
| 30 | + --volume="${{ github.workspace }}:/srv/jekyll" \ |
| 31 | + jekyll/builder:3.8.5 /bin/bash -c "gem install bundler && chmod -R 777 /srv/jekyll && jekyll build && bundle exec just-the-docs rake search:init" |
| 32 | +
|
| 33 | + assets: |
| 34 | + name: Format and test CSS and JS |
| 35 | + runs-on: ubuntu-latest |
| 36 | + |
| 37 | + steps: |
| 38 | + - uses: actions/checkout@v2 |
| 39 | + # Using this so the this instead of GITHUB_TOKEN so that this workflow can trigger another |
| 40 | + with: |
| 41 | + token: ${{ secrets.PAT }} |
| 42 | + - name: Use Node.js 12.x |
| 43 | + uses: actions/setup-node@v1 |
| 44 | + with: |
| 45 | + node-version: '12.x' |
| 46 | + - name: Extract branch name |
| 47 | + shell: bash |
| 48 | + run: echo "##[set-output name=branch;]$(echo ${GITHUB_HEAD_REF#refs/heads/})" |
| 49 | + id: extract_branch |
| 50 | + |
| 51 | + - run: npm install |
| 52 | + - run: npm run format |
| 53 | + - name: Add changed files |
| 54 | + run: | |
| 55 | + echo "https://$GITHUB_ACTOR:[email protected]/$GITHUB_REPOSITORY.git" |
| 56 | + git config --global user.email [email protected] |
| 57 | + git config --global user.name $GITHUB_ACTOR |
| 58 | + echo "extracted branch is ${{ steps.extract_branch.outputs.branch }}" |
| 59 | + git checkout -b ${{ steps.extract_branch.outputs.branch }} |
| 60 | + git status |
| 61 | + git add . |
| 62 | + - name: Are there any updates? |
| 63 | + shell: bash |
| 64 | + run: echo "##[set-output name=status]$(git status -s)" |
| 65 | + id: is_dirty |
| 66 | + - name: Commit files |
| 67 | + if: steps.is_dirty.outputs.status |
| 68 | + run: | |
| 69 | + echo ${{ steps.is_dirty.outputs.status }} |
| 70 | + git commit -m "🎨 Prettier" |
| 71 | + git push --force --set-upstream "https://${GITHUB_ACTOR}:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git" ${{ steps.extract_branch.outputs.branch }} |
| 72 | + - run: npm test |
0 commit comments