-
Notifications
You must be signed in to change notification settings - Fork 0
44 lines (38 loc) · 1.11 KB
/
Copy pathdeploy.yml
File metadata and controls
44 lines (38 loc) · 1.11 KB
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: Build & Deploy API
on:
push:
branches: [ "master" ]
jobs:
build-and-deploy:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Login to GHCR
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build & Push API image
uses: docker/build-push-action@v6
with:
context: .
file: Bibliotrack.API/Dockerfile
push: true
tags: ghcr.io/lucas-woibau/bibliotrack-api:latest
- name: Deploy on VPS (API)
uses: appleboy/ssh-action@v1.0.3
with:
host: ${{ secrets.VPS_HOST }}
username: ${{ secrets.VPS_USER }}
key: ${{ secrets.VPS_SSH_KEY }}
port: ${{ secrets.VPS_SSH_PORT }}
script: |
cd ${{ secrets.VPS_PATH }}
docker compose pull bibliotrack_api
docker compose up -d bibliotrack_api
docker image prune -f