-
Notifications
You must be signed in to change notification settings - Fork 39
84 lines (81 loc) · 3.19 KB
/
main.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
name: Build and deploy
on: [push, pull_request]
jobs:
main:
runs-on: ubuntu-latest
env:
APP_NAME: wallet
ETHERSCAN_API_KEY: "${{ github.ref == 'refs/heads/master' && secrets.ETHERSCAN_API_KEY_PROD || secrets.ETHERSCAN_API_KEY_DEV }}"
WALLET_CONNECT_PROJECT_ID: ${{ secrets.WALLET_CONNECT_PROJECT_ID }}
TOKEN_SALES_URL_MAINNET: ${{ secrets.TOKEN_SALES_URL_MAINNET }}
TOKEN_SALES_URL_TESTNET: ${{ secrets.TOKEN_SALES_URL_TESTNET }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 100
- uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: '17'
- uses: actions/setup-node@v4
with:
node-version: 20.x
- uses: actions/cache@v4
with:
path: ~/.npm
key: ${{ runner.os }}-${{ hashFiles('**/package-lock.json') }}
- name: Install app dependencies
run: npm ci
- name: Build Ionic Vue android app
run: npm run build:android
- name: Build android apk
run: cd android && ./gradlew assembleDebug
- 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
cp -r ./android/app/build/outputs/apk/debug ./dist-stage/artifacts/android
- run: cp ./dist/web/root/index.html ./dist/web/root/404.html
- name: Deploy to production
uses: peaceiris/actions-gh-pages@v4
if: github.ref == 'refs/heads/master'
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: dist/web/root
cname: wallet.superhero.com
- uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
name: Release ${{ github.ref }}
- uses: alexellis/upload-assets@0.4.0
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@v4.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@a9bf050e744c8282dee4bb0dbcf063186d8316c4
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