name: main on: [push] jobs: test: runs-on: ubuntu-latest steps: - run: sudo apt-get install gifsicle graphicsmagick - uses: actions/checkout@v2.3.4 - uses: actions/setup-node@v2.2.0 with: node-version: 16 - uses: bahmutov/npm-install@v1.7.8 - 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.4 - uses: actions/setup-node@v2.2.0 with: node-version: 16 - uses: bahmutov/npm-install@v1.7.8 - run: ( cd packages/gif-creator ; yarn benchmark ) test-action: runs-on: ubuntu-latest needs: build-docker-image steps: - 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.5.0 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.4 - uses: actions/setup-node@v2.2.0 with: node-version: 16 - uses: bahmutov/npm-install@v1.7.8 - 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.5.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 }} build-docker-image: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2.3.4 - uses: actions/setup-node@v2.2.0 with: node-version: 16 - uses: bahmutov/npm-install@v1.7.8 - 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