Skip to content

[SW-1146] Composables migrations #14113

[SW-1146] Composables migrations

[SW-1146] Composables migrations #14113

Workflow file for this run

name: Test, build, and deploy
on: [push, pull_request]
jobs:
main:
runs-on: ubuntu-latest
env:
APP_NAME: wallet
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 100
- uses: actions/setup-node@v3
with:
node-version: 18.x
- uses: actions/cache@v3
with:
path: ~/.npm
key: ${{ runner.os }}-${{ hashFiles('**/package-lock.json') }}
- run: npm ci
- name: Run Commitlint
if: github.event_name == 'pull_request'
env:
HEAD: ${{ github.event.pull_request.head.sha }}
BASE: ${{ github.event.pull_request.base.sha }}
run: npx commitlint --from $BASE --to $HEAD --verbose
- run: npx cross-env NODE_ENV=production npm run lint:vue && npm run lint:css
- run: npm test
- run: |
npm run build:web
npm run build:extension
npm run build-zip
cp -r dist/web/root dist-stage
mv dist-zip dist-stage/artifacts
mkdir -p tests/e2e/screenshots
mv tests/e2e/screenshots dist-stage/artifacts/screenshots
mv tests/pages/index.html dist-stage/artifacts/deeplink-test.html
- run: cp ./dist/web/root/index.html ./dist/web/root/404.html
- name: Deploy to production
uses: peaceiris/actions-gh-pages@v3
if: github.ref == 'refs/heads/master'
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: dist/web/root
cname: wallet.superhero.com
- uses: actions/create-release@v1
if: startsWith(github.ref, 'refs/tags/')
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
- uses: alexellis/upload-assets@0.2.3
if: startsWith(github.ref, 'refs/tags/')
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
asset_paths: '["./dist-stage/artifacts/superhero-wallet-*"]'
- uses: rlespinasse/github-slug-action@v3.x
- name: Deploy to stage
uses: easingthemes/ssh-deploy@v4.1.8
if: github.event_name == 'push'
env:
SSH_PRIVATE_KEY: ${{ secrets.STAGE_PRIVATE_KEY }}
SOURCE: dist-stage/
REMOTE_HOST: z52da5wt.xyz
REMOTE_USER: root
REMOTE_PORT: 2022
TARGET: ${{ format('/data/{0}/{1}', env.APP_NAME, env.GITHUB_REF_SLUG_URL) }}
- uses: unsplash/comment-on-pr@85a56be792d927ac4bfa2f4326607d38e80e6e60
if: github.event_name == 'pull_request'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
HOST: ${{ format('{0}.{1}.z52da5wt.xyz', env.GITHUB_HEAD_REF_SLUG_URL, env.APP_NAME) }}
with:
msg: Deployed to [${{ env.HOST }}](https://${{ env.HOST }}), [artifacts](https://${{ env.HOST }}/artifacts)
check_for_duplicate_msg: true