forked from MyEtherWallet/MyEtherWallet
-
Notifications
You must be signed in to change notification settings - Fork 2
82 lines (71 loc) · 3.19 KB
/
deploy-live.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
name: deploy live [v6]
on:
push:
tags:
- 'v6.*'
jobs:
deploy-live:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
ref: main
- name: verify tag
run: |
echo $GITHUB_SHA
git branch --contains $GITHUB_SHA
git branch --contains $GITHUB_SHA | sed -e 's/^[ \t *]*//' | grep '^main$'
git checkout $GITHUB_SHA
- name: setup env
id: node-version
run: |
docker build -t mew-build-container .
echo ::set-output name=NODE_VERSION::$(docker run --rm -v `pwd`:/home:rw mew-build-container /bin/bash -c "node --version")
- name: Cache node modules
uses: actions/cache@v2
with:
path: node_modules
key: ${{ runner.os }}-node-${{steps.node-version.outputs.NODE_VERSION}}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-${{steps.node-version.outputs.NODE_VERSION}}-
- name: npm install
run: docker run --rm -v `pwd`:/home:rw --user "$(id -u):$(id -g)" mew-build-container /bin/bash -c "npm install"
- name: build
run: docker run --rm -v `pwd`:/home:rw mew-build-container /bin/bash -c "npm run build:history:sourcemaps"
- name: Get release tag
id: get_release_tag
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}
- name: deploy to sentry
env:
SENTRY_AUTH_TOKEN: ${{secrets.SENTRY_TOKEN}}
SENTRY_ORG: myetherwallet-inc
run: |
curl -sL https://sentry.io/get-cli/ | bash
TAG=${{ steps.get_release_tag.outputs.VERSION }}
RELEASE=${TAG//v/}
sentry-cli releases new -p myetherwallet-web-v6 $RELEASE
sentry-cli releases -p myetherwallet-web-v6 files $RELEASE upload-sourcemaps ./dist/sourcemaps --url-prefix 'https://www.myetherwallet.com/sourcemaps' --rewrite --validate
sentry-cli releases set-commits $RELEASE --auto
sentry-cli releases finalize $RELEASE
- name: deploy to production
env:
AWS_DEFAULT_REGION: ${{secrets.AWS_DEFAULT_REGION}}
AWS_ACCESS_KEY_ID: ${{secrets.AWS_ACCESS_KEY_ID}}
AWS_SECRET_ACCESS_KEY: ${{secrets.AWS_SECRET_ACCESS_KEY}}
run: |
pip install --user awscli
aws s3 sync dist/ s3://mewbuilds/staging/ --delete --cache-control max-age=172800,public \
--acl public-read
aws s3 cp s3://mewbuilds/staging/service-worker.js s3://mewbuilds/staging/service-worker.js \
--metadata-directive REPLACE --cache-control max-age=0,no-cache,no-store,must-revalidate \
--content-type application/javascript --acl public-read
aws s3 cp s3://mewbuilds/staging/index.html s3://mewbuilds/staging/index.html \
--metadata-directive REPLACE --cache-control max-age=0,no-cache,no-store,must-revalidate \
--content-type text/html --acl public-read
- name: deploy to gh-pages-history
uses: JamesIves/github-pages-deploy-action@releases/v3
with:
ACCESS_TOKEN: ${{ secrets.MEW_BOT_TOKEN }}
BRANCH: gh-pages-history
FOLDER: dist
CLEAN: true