Choices/.github/workflows/deployment.yml

51 lines
1.2 KiB
YAML
Raw Normal View History

name: Publish and deploy
on:
release:
types: [published]
jobs:
publish-npm:
runs-on: ubuntu-latest
steps:
2021-12-31 02:16:52 +01:00
- uses: actions/checkout@v2
with:
fetch-depth: 1
2021-12-31 02:16:52 +01:00
- uses: actions/setup-node@v2
with:
node-version: 12
registry-url: https://registry.npmjs.org/
- run: npm ci
env:
CYPRESS_INSTALL_BINARY: 0
HUSKY_SKIP_INSTALL: true
- run: npm publish
env:
2019-10-24 18:20:57 +02:00
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
deploy-gh-pages:
needs: publish-npm
2019-10-24 18:20:57 +02:00
runs-on: ubuntu-latest
steps:
2021-12-31 02:16:52 +01:00
- uses: actions/checkout@v2
2019-10-24 18:20:57 +02:00
with:
fetch-depth: 1
2021-12-31 02:16:52 +01:00
- uses: actions/setup-node@v2
2019-10-24 18:20:57 +02:00
with:
node-version: 12
2019-10-24 18:20:57 +02:00
registry-url: https://registry.npmjs.org/
- name: Build
run: |
npm ci
npm run build
rm -rf public/test
env:
CYPRESS_INSTALL_BINARY: 0
HUSKY_SKIP_INSTALL: true
2019-10-24 18:20:57 +02:00
- name: Deploy
2021-12-31 02:16:52 +01:00
uses: peaceiris/actions-gh-pages@v3
2019-10-24 18:20:57 +02:00
env:
2021-12-31 02:16:52 +01:00
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2019-10-24 18:20:57 +02:00
PUBLISH_BRANCH: gh-pages
PUBLISH_DIR: ./public