Skip to content

Move permissions declaration to correct spot #6

Move permissions declaration to correct spot

Move permissions declaration to correct spot #6

Workflow file for this run

name: Build and Push Container Images
on:
push:
branches:
- containers
pull_request:
branches:
- containers
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
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