Created
November 6, 2020 15:10
-
-
Save shun-shobon/7b6b2559c0424cf7dcc2b10a7f9fcd9d to your computer and use it in GitHub Desktop.
GitHub Actionsのテンプレート
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: ci | |
on: push | |
jobs: | |
lint: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions/setup-node@v1 | |
with: | |
node-version: 14 | |
- id: yarn-cache | |
run: echo "::set-output name=dir::$(yarn cache dir)" | |
- uses: actions/cache@v1 | |
with: | |
path: ${{ steps.yarn-cache.outputs.dir }} | |
key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }} | |
restore-keys: ${{ runner.os }}- | |
- run: yarn install --frozen-lockfile | |
- name: Run list | |
run: yarn lint | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions/setup-node@v1 | |
with: | |
node-version: 14 | |
- id: yarn-cache | |
run: echo "::set-output name=dir::$(yarn cache dir)" | |
- uses: actions/cache@v1 | |
with: | |
path: ${{ steps.yarn-cache.outputs.dir }} | |
key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }} | |
restore-keys: ${{ runner.os }}- | |
- run: yarn install --frozen-lockfile | |
- name: Run test | |
run: yarn test:ci | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions/setup-node@v1 | |
with: | |
node-version: 14 | |
- id: yarn-cache | |
run: echo "::set-output name=dir::$(yarn cache dir)" | |
- uses: actions/cache@v1 | |
with: | |
path: ${{ steps.yarn-cache.outputs.dir }} | |
key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }} | |
restore-keys: ${{ runner.os }}- | |
- run: yarn install --frozen-lockfile | |
- name: Run build | |
run: | | |
yarn clean | |
yarn build | |
- name: Upload dist | |
uses: actions/upload-artifact@v2 | |
with: | |
name: dist | |
path: dist |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment