-
Notifications
You must be signed in to change notification settings - Fork 0
36 lines (36 loc) · 1002 Bytes
/
deploy-docker.yml
File metadata and controls
36 lines (36 loc) · 1002 Bytes
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
name: Deploy App and Test
on:
push:
tags:
- 'v*'
workflow_dispatch:
jobs:
deploy:
runs-on: ubuntu-latest
timeout-minutes: 30
env:
GIT_TAG: ${{ github.ref_name }}
steps:
- name: SSH into VM and deploy
uses: appleboy/ssh-action@v1
with:
host: "15.222.16.78"
username: ubuntu
key: ${{ secrets.KEY }}
port: 22
envs: GIT_TAG
script: |
sleep 150
cd epiready
git fetch --tags
TAG_NO_V=${GIT_TAG#v}
export TAG_NO_V
echo "Deploying version: $TAG_NO_V"
git checkout $GIT_TAG || true
docker compose pull
docker compose up -d
echo "Running Cypress tests in Cypress container..."
docker compose run --rm cypress
echo "Running performance test on deployed website..."
sudo apt-get update && sudo apt-get install -y apache2-utils
ab -n 100 -c 10 https://epiready.taggit.tech/