-
Notifications
You must be signed in to change notification settings - Fork 5
34 lines (31 loc) · 1.1 KB
/
deploy.yml
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
name: Deploy
run-name: ${{ github.actor }} is building ${{ github.sha }}
on:
push:
branches:
- main
workflow_dispatch:
jobs:
Deploy:
runs-on: ubuntu-latest
steps:
- name: "Checkout GitHub Action"
uses: actions/checkout@v4
- name: "Login to GitHub Container Registry"
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{github.actor}}
password: ${{secrets.GITHUB_TOKEN}}
- name: "Build and Push Image"
run: |
docker build -t typetoast/frontend --build-arg NEXT_BASE_API_URL=${{secrets.NEXT_BASE_API_URL}} .
docker tag typetoast/frontend:latest ghcr.io/saliovin/typetoast/frontend:latest
docker push ghcr.io/saliovin/typetoast/frontend:latest
- name: Restarting Docker Compose Through SSH
uses: appleboy/ssh-action@v1.0.3
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
key: ${{ secrets.KEY }}
script: sudo docker compose pull typetoast-frontend && sudo docker compose up -d --remove-orphans