-
Notifications
You must be signed in to change notification settings - Fork 0
37 lines (36 loc) · 1.03 KB
/
build.yml
File metadata and controls
37 lines (36 loc) · 1.03 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
name: Docker Image CI
on:
push:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Extract metadata
run: echo "BRANCH=${GITHUB_REF##*/}" >> $GITHUB_ENV
- name: Login to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build Frontend
uses: docker/build-push-action@v2
with:
push: true
context: ./frontend
tags: ghcr.io/solid-polls/solid/solid-frontend:${{ env.BRANCH }}
- name: Build Backend
uses: docker/build-push-action@v2
with:
push: true
context: ./backend
tags: ghcr.io/solid-polls/solid/solid-backend:${{ env.BRANCH }}
- name: Deploy
uses: appleboy/ssh-action@master
if: ${{ env.BRANCH == 'main' }}
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
key: ${{ secrets.KEY }}
script: /root/update.sh