forked from redbrick/atlas
-
Notifications
You must be signed in to change notification settings - Fork 1
44 lines (36 loc) · 1008 Bytes
/
deploy-to-vps.yaml
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
name: Deploy main to Huey-Dewey-Louie
on:
push:
branches:
- main
paths-ignore:
- '.gitignore'
- '.gitattributes'
- '.editorconfig'
- 'yarn.lock'
- 'package-lock.json'
- 'sonar-project.properties'
- 'README.md'
- 'docs/**'
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Setup SSH
uses: webfactory/[email protected]
with:
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}
- name: Build and Deploy with Docker Compose
run: |
ssh -o StrictHostKeyChecking=no ${{ secrets.USERNAME }}@${{ secrets.HOST }} << 'EOF'
cd /src/Website
git reset --hard HEAD
git pull origin main
touch .env
chmod 644 .env
echo "EXPOSED_PORT=${{secrets.EXPOSED_PORT}}" > .env
docker compose up -d --build
docker image prune -f
EOF