-
Notifications
You must be signed in to change notification settings - Fork 0
47 lines (39 loc) · 1.23 KB
/
build-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
35
36
37
38
39
40
41
42
43
44
45
46
47
name: Build and Push Container Images
on:
push:
branches:
- containers
pull_request:
branches:
- containers
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v3
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 22.8.0
- name: Install dependencies and build frontend
run: |
cd frontend
npm ci
npm run build
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN}}
# 4. Build and push Frontend Docker image to GHCR
- name: Build Frontend Docker image
run: |
docker build -t ghcr.io/jharworth21/hacksheffield-9/frontend:latest ./frontend
docker push ghcr.io/jharworth21/hacksheffield-9/frontend:latest
# 5. Build and push Backend Docker image to GHCR
- name: Build Backend Docker image
run: |
docker build -t ghcr.io/jharworth21/hacksheffield-9/backend:latest ./backend
docker push ghcr.io/jharworth21/hacksheffield-9/backend:latest