113 lines
2.8 KiB
YAML
113 lines
2.8 KiB
YAML
name: main
|
|
|
|
on: [push]
|
|
|
|
jobs:
|
|
test:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- run: sudo apt-get install gifsicle graphicsmagick
|
|
- uses: actions/checkout@v2.3.3
|
|
- uses: actions/setup-node@v1.4.4
|
|
with:
|
|
node-version: 14
|
|
|
|
- uses: bahmutov/npm-install@v1.4.3
|
|
|
|
- run: yarn type
|
|
- run: yarn lint
|
|
- run: yarn test --ci
|
|
|
|
test-benchmark:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- run: sudo apt-get install gifsicle graphicsmagick
|
|
- uses: actions/checkout@v2.3.3
|
|
- uses: actions/setup-node@v1.4.4
|
|
with:
|
|
node-version: 14
|
|
|
|
- uses: bahmutov/npm-install@v1.4.3
|
|
|
|
- run: ( cd packages/gif-creator ; yarn benchmark )
|
|
|
|
test-action:
|
|
runs-on: ubuntu-latest
|
|
needs: build-docker-image
|
|
|
|
steps:
|
|
- run: mkdir dist
|
|
|
|
- name: generate-snake-game-from-github-contribution-grid
|
|
id: snake-gif
|
|
uses: Platane/snk@master
|
|
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 -l ${{ steps.snake-gif.outputs.gif_out_path }}
|
|
test -f ${{ steps.snake-gif.outputs.gif_out_path }}
|
|
|
|
- uses: crazy-max/ghaction-github-pages@v2.1.3
|
|
with:
|
|
target_branch: output
|
|
build_dir: dist
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.MY_GITHUB_TOKEN_GH_PAGES }}
|
|
|
|
deploy-ghpages:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v2.3.3
|
|
- uses: actions/setup-node@v1.4.4
|
|
with:
|
|
node-version: 14
|
|
|
|
- uses: bahmutov/npm-install@v1.4.3
|
|
|
|
- run: yarn build:demo
|
|
|
|
- uses: crazy-max/ghaction-github-pages@v2.1.3
|
|
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 }}
|
|
|
|
build-docker-image:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v2.3.3
|
|
- uses: actions/setup-node@v1.4.4
|
|
with:
|
|
node-version: 14
|
|
|
|
- uses: bahmutov/npm-install@v1.4.3
|
|
|
|
- run: yarn build:action
|
|
|
|
- uses: docker/setup-qemu-action@v1
|
|
|
|
- uses: docker/setup-buildx-action@v1
|
|
|
|
- uses: docker/login-action@v1
|
|
with:
|
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
|
|
|
- uses: docker/build-push-action@v2
|
|
id: docker_build
|
|
with:
|
|
push: ${{ github.ref == 'refs/heads/master' }}
|
|
tags: |
|
|
platane/snk:latest
|
|
platane/snk:${{ github.sha }}
|
|
file: packages/action/Dockerfile
|
|
context: packages/action
|