-
Notifications
You must be signed in to change notification settings - Fork 18
47 lines (44 loc) · 2.25 KB
/
deploy.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
name: Push Workflow
on: push
jobs:
messenger-demo-deploy:
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/${{ vars.STAGING_BRANCH }}'
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v3
with:
registry-url: 'https://npm.pkg.github.com'
node-version: 18.0.0
cache: 'yarn'
- name: Prepare SSH
run: |
mkdir ~/.ssh
echo "${{ secrets.STAGING_HOST_SSH }}" > ~/.ssh/known_hosts
echo "${{ secrets.DO_SSH_KEY }}" > ./ssh-key
chmod 600 ./ssh-key
- name: Create .env file
run: |
echo "REACT_APP_ADDR_ENS_SUBDOMAIN=.beta-addr.dm3.eth" >> ./.env
echo "REACT_APP_BACKEND=http://${{ secrets.STAGING_HOST }}" >> ./.env
echo "REACT_APP_DEFAULT_DELIVERY_SERVICE=beta-ds.dm3.eth" >> ./.env
echo "REACT_APP_DEFAULT_SERVICE=http://${{ secrets.STAGING_HOST }}" >> ./.env
echo "REACT_APP_ETHEREUM_PROVIDER=${{ secrets.REACT_APP_ETHEREUM_PROVIDER }}" >> ./.env
echo "REACT_APP_PROFILE_BASE_URL=http://dm3-beta2-resolver.herokuapp.com" >> ./.env
echo "REACT_APP_RESOLVER_BACKEND=http://dm3-beta2-resolver.herokuapp.com" >> ./.env
echo "REACT_APP_USER_ENS_SUBDOMAIN=.beta-user.dm3.eth" >> ./.env
echo "REACT_APP_WALLET_CONNECT_PROJECT_ID=${{ secrets.REACT_APP_WALLET_CONNECT_PROJECT_ID }}" >> ./.env
echo "RESOLVER_ADDR=0x45F7Ed7d05c563D408898A80d9C705CC3328D2EF" >> ./.env
echo WEB_PORT=80 >> ./.env
- name: Prepare dir
run: |
ssh -i ./ssh-key app@${{ secrets.STAGING_HOST }} "\
rm -rf dm3;\
mkdir dm3"
- name: Sync files
run: rsync -avz -e 'ssh -i ./ssh-key' ./ app@${{ secrets.STAGING_HOST }}:/home/app/dm3
- name: Build
run: |
ssh -i ./ssh-key app@${{ secrets.STAGING_HOST }} "\
cd dm3;\
docker build --progress=plain -t dm3-backend -f ./docker/Dockerfile ."