-
Notifications
You must be signed in to change notification settings - Fork 1
92 lines (87 loc) · 2.79 KB
/
deploy-frontend.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
85
86
87
88
89
90
91
92
# This workflow deploys the olahd-user-frontend on the servers. Deployment is done with an existing
# script on the server. This script updates the sources, shuts down user-frontend docker-containers
# and finally builds and starts it again.
name: Deploy olahd-user-frontend
on:
push:
branches:
- 'main'
- 'develop'
tags:
#- 'refs/tags/v*'
- 'v[0-9]+.[0-9]+.[0-9]+'
workflow_dispatch:
jobs:
deploy-develop:
name: Deploy to develop
environment:
name: Develop
if: github.event.ref == 'refs/heads/develop'
runs-on: ubuntu-latest
steps:
- name: copy key
run: |
mkdir -p ~/.ssh/
echo "$SSH_KEY" > ~/.ssh/key
chmod 600 ~/.ssh/key
env:
SSH_KEY: ${{ secrets.OLAHD_SSH_KEY }}
- name: deploy to server
run: ssh $SSH_USER@$SSH_HOST -o StrictHostKeyChecking=no -i ~/.ssh/key /home/$SSH_USER/start-olahd-docker.sh -u
env:
SSH_USER: ${{ secrets.OLAHD_SSH_USER }}
SSH_HOST: ${{ secrets.OLAHD_SSH_HOST_DEV }}
deploy-staging:
name: Deploy to staging
environment:
name: Staging
if: github.event.ref == 'refs/heads/main'
runs-on: ubuntu-latest
steps:
- name: copy key
run: |
mkdir -p ~/.ssh/
echo "$SSH_KEY" > ~/.ssh/key
chmod 600 ~/.ssh/key
env:
SSH_KEY: ${{ secrets.OLAHD_SSH_KEY }}
- name: deploy to server
run: ssh $SSH_USER@$SSH_HOST -o StrictHostKeyChecking=no -i ~/.ssh/key /home/$SSH_USER/start-olahd-docker.sh -u
env:
SSH_USER: ${{ secrets.OLAHD_SSH_USER }}
SSH_HOST: ${{ secrets.OLAHD_SSH_HOST_STAGE }}
deploy-production:
name: Deploy to production
environment:
name: Production
#if: startsWith(github.event.ref, 'refs/tags/v')
if: startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
steps:
- name: copy key
run: |
mkdir -p ~/.ssh/
echo "$SSH_KEY" > ~/.ssh/key
chmod 600 ~/.ssh/key
env:
SSH_KEY: ${{ secrets.OLAHD_SSH_KEY }}
- name: deploy to server
run: ssh $SSH_USER@$SSH_HOST -o StrictHostKeyChecking=no -i ~/.ssh/key /home/$SSH_USER/start-olahd-docker.sh -u
env:
SSH_USER: ${{ secrets.OLAHD_SSH_USER }}
SSH_HOST: ${{ secrets.OLAHD_SSH_HOST_PROD }}
run-tests-develop:
needs: deploy-develop
name: Run cypress tests on develop-vm after new deployment
environment:
name: Develop
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Cypress run
uses: cypress-io/github-action@v6
with:
config: baseUrl=${{ secrets.BASE_URL_TESTS_DEVELOP }}
env:
CYPRESS_PASSWORD: ${{ secrets.OLAHD_LOGIN_PASSWORD }}