publish-packages #93
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: publish-packages | |
on: workflow_dispatch | |
jobs: | |
publish-packages: | |
runs-on: ubuntu-latest | |
env: | |
TEST_ENDPOINT: dapp-example.onekeytest.com | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions/setup-node@v2 | |
with: | |
node-version: '16.x' | |
registry-url: 'https://registry.npmjs.org' | |
- name: Install Packages | |
# global env make ci `yarn && yarn bootstrap` not correctly | |
run: | | |
yarn | |
yarn bootstrap | |
NODE_ENV=production yarn build | |
yarn test | |
yarn lint | |
- name: Publish | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
# TODO check published packages injected is minified | |
run: | | |
git reset --hard | |
NODE_ENV=production yarn publish-packages -y | |
- name: Sleep for 90 seconds | |
uses: jakejarvis/wait-action@master | |
with: | |
time: '90s' | |
- name: Build Example Web | |
run: | | |
yarn clean-workspace | |
yarn example-build | |
cp ./packages/example/out/index.html ./packages/example/out/404.html | |
- name: Deploy Github Pages | |
uses: peaceiris/actions-gh-pages@v3 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: ./packages/example/out | |
cname: ${{ env.TEST_ENDPOINT }} | |
force_orphan: true |