85 lines
2.2 KiB
YAML
85 lines
2.2 KiB
YAML
name: main
|
|
|
|
on: [push]
|
|
|
|
jobs:
|
|
test:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- uses: actions/setup-node@v2
|
|
with:
|
|
cache: yarn
|
|
node-version: 16
|
|
- run: yarn install --frozen-lockfile
|
|
|
|
- run: yarn type
|
|
- run: yarn lint
|
|
- run: yarn test --ci
|
|
|
|
test-benchmark:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- uses: actions/setup-node@v2
|
|
with:
|
|
cache: yarn
|
|
node-version: 16
|
|
- run: yarn install --frozen-lockfile
|
|
|
|
- run: ( cd packages/gif-creator ; yarn benchmark )
|
|
|
|
test-action:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
|
|
- name: update action.yml to use image from local Dockerfile
|
|
run: |
|
|
sed -i "s/image: .*/image: Dockerfile/" action.yml
|
|
|
|
- name: generate-snake-game-from-github-contribution-grid
|
|
id: generate-snake
|
|
uses: ./
|
|
with:
|
|
github_user_name: platane
|
|
gif_out_path: dist/github-contribution-grid-snake.gif
|
|
svg_out_path: dist/github-contribution-grid-snake.svg
|
|
|
|
- name: ensure the generated file exists
|
|
run: |
|
|
ls dist
|
|
test -f ${{ steps.generate-snake.outputs.gif_out_path }}
|
|
test -f ${{ steps.generate-snake.outputs.svg_out_path }}
|
|
|
|
- uses: crazy-max/ghaction-github-pages@v2.5.0
|
|
with:
|
|
target_branch: output
|
|
build_dir: dist
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
deploy-ghpages:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- uses: actions/setup-node@v2
|
|
with:
|
|
cache: yarn
|
|
node-version: 16
|
|
- run: yarn install --frozen-lockfile
|
|
|
|
- run: yarn build:demo
|
|
env:
|
|
GITHUB_USER_CONTRIBUTION_API_ENDPOINT: https://snk-one.vercel.app/api/github-user-contribution/
|
|
|
|
- uses: crazy-max/ghaction-github-pages@v2.6.0
|
|
if: success() && github.ref == 'refs/heads/master'
|
|
with:
|
|
target_branch: gh-pages
|
|
build_dir: packages/demo/dist
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.MY_GITHUB_TOKEN_GH_PAGES }}
|