-
Notifications
You must be signed in to change notification settings - Fork 4
42 lines (35 loc) · 1.08 KB
/
deploy.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
name: Build & Deploy on server
on:
push:
branches: [release]
jobs:
build_and_push:
runs-on: ubuntu-latest
steps:
- name: Checkout the repo
uses: actions/checkout@v2
- name: Create .env file
run: |
touch .env
echo "${{ secrets.ENV }}" > .env
- name: Build image
run: docker compose -f docker-compose.yml build
- name: Login to GitHub Package Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Push image to GitHub Container Registry
run: docker compose -f docker-compose.yml push
- name: Deploy
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.SSH_HOST }}
username: ${{ secrets.SSH_USERNAME }}
key: ${{ secrets.SSH_SECRET }}
port: ${{ secrets.SSH_PORT }}
script: |
cd /home/scriptio
docker pull ghcr.io/lycoon/scriptio-app:latest
docker-compose up -d