Skip to content

Commit

Permalink
build: create build-backend-image.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
jdkuffa authored Oct 17, 2024
1 parent c43a413 commit bd5d1f2
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/build-backend-image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
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

0 comments on commit bd5d1f2

Please sign in to comment.