-
Notifications
You must be signed in to change notification settings - Fork 11
50 lines (46 loc) · 1.4 KB
/
test.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
#Workflow for test environment
name: test-CI
on: push
jobs:
build:
runs-on: ubuntu-latest
container: alexsuch/angular-cli:12.2.10
steps:
- name: Checkout project
uses: actions/checkout@v3
- name: Create temporary .env file and print a build number
run: |
touch .env
echo ${{ github.run_id }}.${{ github.run_number }} >> .env
- name: Build
run: |
npm install
node .utils/write-build-number.js
npm run build-dev
- name: Delete temporary files
run: |
rm .env
- name: Upload project artifacts
uses: actions/upload-artifact@v3
with:
path: dist/
name: project
deploy-test:
needs: build
runs-on: ubuntu-latest
steps:
- name: Download artifacts
uses: actions/download-artifact@v3
with:
name: project
- name: Install SSH Key
uses: shimataro/ssh-key-action@v2
with:
key: ${{ secrets.DROPLET_KEY }}
known_hosts: ${{ secrets.DROPLET_HOST }}
- name: Deploy with rsync
run: rsync -zhrl -e 'ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null' frontend/ $SSH_USER@$SSH_HOST:$PROJECT_PATH
env:
SSH_USER: ${{ secrets.DROPLET_USER }}
SSH_HOST: ${{ secrets.DROPLET_HOST }}
PROJECT_PATH: ${{ secrets.DROPLET_FRONTEND_TEST_PATH }}