-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build: create build-backend-image.yml
- Loading branch information
Showing
1 changed file
with
40 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |