-
Notifications
You must be signed in to change notification settings - Fork 1
40 lines (36 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
on:
push:
branches:
- main
- CC-321-Deploy-to-virtual-machine # Only for testing
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
deploy:
runs-on: self-hosted
name: Deploy to DETI machine
env:
PRODUCTION: true
CURRENCY_API_KEY: ${{secrets.CURRENCY_API_KEY}}
JWT_PRIVATE: ${{secrets.JWT_PRIVATE}}
JWT_PUBLIC: ${{secrets.JWT_PUBLIC}}
POSTGRES_PASSWORD: ${{secrets.POSTGRES_PASSWORD}}
HOST_URL: deti-tqs-16.ua.pt
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Login to GitHub Packages
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Deploy with Docker Compose
run: |
docker compose -f compose.prod.yaml pull
docker compose -f compose.prod.yaml up -d --remove-orphans
docker container prune -f
docker image prune -af
docker builder prune -af