mirror of
https://github.com/peaceiris/actions-gh-pages.git
synced 2025-07-15 14:43:21 +08:00
ci: Add test-ubuntu-20.04 job (#270)
- Bumps mdBook from 0.3.6 to 0.3.7 - Add test job for ubuntu 20.04 cf. #268
This commit is contained in:
parent
b9cccec41e
commit
7501463241
81
.github/workflows/test.yml
vendored
81
.github/workflows/test.yml
vendored
@ -89,7 +89,7 @@ jobs:
|
|||||||
if: github.ref == 'refs/heads/master'
|
if: github.ref == 'refs/heads/master'
|
||||||
uses: peaceiris/actions-mdbook@v1
|
uses: peaceiris/actions-mdbook@v1
|
||||||
with:
|
with:
|
||||||
mdbook-version: '0.3.6'
|
mdbook-version: '0.3.7'
|
||||||
|
|
||||||
- name: Build site
|
- name: Build site
|
||||||
if: github.ref == 'refs/heads/master'
|
if: github.ref == 'refs/heads/master'
|
||||||
@ -170,3 +170,82 @@ jobs:
|
|||||||
user_name: 'github-actions[bot]'
|
user_name: 'github-actions[bot]'
|
||||||
user_email: 'github-actions[bot]@users.noreply.github.com'
|
user_email: 'github-actions[bot]@users.noreply.github.com'
|
||||||
# commit_message: ${{ github.event.head_commit.message }}
|
# commit_message: ${{ github.event.head_commit.message }}
|
||||||
|
|
||||||
|
test-ubuntu-2004:
|
||||||
|
runs-on: 'ubuntu-18.04'
|
||||||
|
if: contains(github.event.head_commit.message, '[skip ci]') == false
|
||||||
|
container:
|
||||||
|
image: 'ubuntu:20.04'
|
||||||
|
steps:
|
||||||
|
- name: Install deps
|
||||||
|
run: |
|
||||||
|
apt update
|
||||||
|
apt install -y software-properties-common
|
||||||
|
add-apt-repository ppa:git-core/ppa
|
||||||
|
apt update
|
||||||
|
apt install -y \
|
||||||
|
git \
|
||||||
|
ssh
|
||||||
|
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
|
||||||
|
- name: Dump GitHub context
|
||||||
|
env:
|
||||||
|
GITHUB_CONTEXT: ${{ toJson(github) }}
|
||||||
|
run: echo "${GITHUB_CONTEXT}"
|
||||||
|
|
||||||
|
- name: Read .nvmrc
|
||||||
|
run: echo "::set-output name=NVMRC::$(cat .nvmrc)"
|
||||||
|
id: nvm
|
||||||
|
|
||||||
|
- name: Setup Node
|
||||||
|
uses: actions/setup-node@v1
|
||||||
|
with:
|
||||||
|
node-version: '${{ steps.nvm.outputs.NVMRC }}'
|
||||||
|
|
||||||
|
- run: npm i -g npm
|
||||||
|
|
||||||
|
- name: Dump version
|
||||||
|
run: |
|
||||||
|
node -v
|
||||||
|
npm --version
|
||||||
|
git --version
|
||||||
|
|
||||||
|
- run: npm ci
|
||||||
|
- run: npm test
|
||||||
|
|
||||||
|
- name: Run ncc
|
||||||
|
run: npm run build
|
||||||
|
|
||||||
|
- name: Remove lint-staged husky
|
||||||
|
if: github.ref == 'refs/heads/master'
|
||||||
|
run: |
|
||||||
|
npm uninstall lint-staged husky
|
||||||
|
git checkout package-lock.json package.json
|
||||||
|
|
||||||
|
- name: Setup mdBook
|
||||||
|
if: github.ref == 'refs/heads/master'
|
||||||
|
uses: peaceiris/actions-mdbook@v1
|
||||||
|
with:
|
||||||
|
mdbook-version: '0.3.7'
|
||||||
|
|
||||||
|
- name: Build site
|
||||||
|
if: github.ref == 'refs/heads/master'
|
||||||
|
working-directory: ./test_projects/mdbook
|
||||||
|
run: mdbook build
|
||||||
|
|
||||||
|
- name: Deploy
|
||||||
|
if: github.ref == 'refs/heads/master'
|
||||||
|
uses: ./
|
||||||
|
with:
|
||||||
|
# deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }}
|
||||||
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
publish_branch: gh-pages-ubuntu-20.04
|
||||||
|
publish_dir: ./test_projects/mdbook/book
|
||||||
|
# external_repository: ''
|
||||||
|
allow_empty_commit: true
|
||||||
|
# keep_files: true
|
||||||
|
# force_orphan: true
|
||||||
|
user_name: 'github-actions[bot]'
|
||||||
|
user_email: 'github-actions[bot]@users.noreply.github.com'
|
||||||
|
# commit_message: ${{ github.event.head_commit.message }}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user