-
Notifications
You must be signed in to change notification settings - Fork 18
64 lines (63 loc) · 2.35 KB
/
deploy_development.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
name: Deploy to development env
on:
push:
branches:
- dev
jobs:
deploy:
runs-on: ubuntu-latest
environment: development
steps:
- name: Install SSH Key
uses: kielabokkie/ssh-key-and-known-hosts-action@v1
with:
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}
ssh-host: ${{ secrets.SSH_HOST_NEW_IP }}
ssh-port: ${{ secrets.SSH_HOST_NEW_PORT }}
- name: Checkout repo
uses: actions/checkout@v4
- name: Setup Node JS
uses: actions/setup-node@v4
with:
node-version: 20
cache: "npm"
- name: Install dependencies
run: npm ci
- name: Run linter & formatter
run: npm run check
- name: Run tests
run: npm test
- name: Run TypeScript typecheck
run: npm run typecheck
- name: Set git commit
run: echo "VITE_GIT_COMMIT=$(git rev-parse --short HEAD)" >> $GITHUB_ENV
- name: Build app (main)
env:
VITE_ENV: development
VITE_DEFAULT_LANG: en
VITE_OSM_API_URL: "https://master.apis.dev.openstreetmap.org"
VITE_OSM_OAUTH2_CLIENT_ID: ${{ secrets.REACT_APP_OSM_OAUTH2_CLIENT_ID }}
VITE_BACKEND_API_URL: "https://dev.openaedmap.org"
VITE_SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
run: npm run build
- name: Create robots.txt
run: |
cat << 'EOF' > build/robots.txt
# https://www.robotstxt.org/robotstxt.html
User-agent: *
Disallow: /
EOF
- name: Copy main build to server
run: |
rsync -rp -e 'ssh -p ${{ secrets.SSH_HOST_NEW_PORT }}' build/* ${{ secrets.SSH_USER_NEW }}@${{ secrets.SSH_HOST_NEW_IP }}:~/dev-static/
- name: Build app lang versions
env:
VITE_ENV: development
VITE_OSM_API_URL: "https://master.apis.dev.openstreetmap.org"
VITE_OSM_OAUTH2_CLIENT_ID: ${{ secrets.REACT_APP_OSM_OAUTH2_CLIENT_ID }}
VITE_BACKEND_API_URL: "https://dev.openaedmap.org"
VITE_SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
run: ./scripts/build_every_lang.sh
- name: Copy lang version builds to server
run: |
rsync -rp --delete -e 'ssh -p ${{ secrets.SSH_HOST_NEW_PORT }}' build/* ${{ secrets.SSH_USER_NEW }}@${{ secrets.SSH_HOST_NEW_IP }}:~/dev-static/