Skip to content

Merge pull request #13 from jhaworth21/mongodb #19

Merge pull request #13 from jhaworth21/mongodb

Merge pull request #13 from jhaworth21/mongodb #19

Workflow file for this run

name: Build and Push Container Images
on:
push:
tags:
- 'v*' # Matches tags starting with "v" (e.g., v1.0, v2.1.0)
permissions:
contents: read
packages: write
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/jhaworth21/hacksheffield-9/frontend:latest ./frontend
docker push ghcr.io/jhaworth21/hacksheffield-9/frontend:latest
# 5. Build and push Backend Docker image to GHCR
- name: Build Backend Docker image
run: |
docker build -t ghcr.io/jhaworth21/hacksheffield-9/backend:latest ./backend
docker push ghcr.io/jhaworth21/hacksheffield-9/backend:latest