Skip to content

Create build-backend-image.yml #1

Create build-backend-image.yml

Create build-backend-image.yml #1

name: Build Backend Docker Image
on:
push:
branches:
- master
- "backend/"
- "backend/scopeBackend"
pull_request:
branches:
- master
- "backend/"
- "backend/scopeBackend"
# these path settings ensure this workflow only executes on a push
# to this YML itself, or any file in the backend or scopeBackend folders
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Check out the repository
uses: actions/checkout@v4
- name: Log in to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
# note: GH sets up this token for you
- name: Build and push the Docker image
run: docker build -t ghcr.io/${{ github.repository_owner }}/backend:latest ./backend
- name: Push the Docker image
run: docker push ghcr.io/${{ github.repository_owner }}/backend:latest