Skip to content

Commit

Permalink
Merge pull request #152 from Kerosene-Labs/BIL-6-update-fixed
Browse files Browse the repository at this point in the history
BIL-6: e
  • Loading branch information
hlafaille authored Jan 2, 2025
2 parents 4dc34ff + ebd1b69 commit d85ab1a
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 4 deletions.
4 changes: 3 additions & 1 deletion .github/actions/target-specific-command/action.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: Target-specific command
description: Run a shell command dependning on the intended deployment target
description: Run a shell command dependning on the intended deployment target. This also sets the $TARGET environment variable.
inputs:
production:
description: Shell command to run for production
Expand All @@ -21,8 +21,10 @@ runs:
if [[ "${{ github.ref }}" == refs/tags/* ]]; then
${{ inputs.production }}
echo "TARGET=production" >> $GITHUB_ENV
elif [[ "${{ github.ref }}" == "refs/heads/develop" ]]; then
${{ inputs.develop }}
echo "TARGET=develop" >> $GITHUB_ENV
else
echo "Invalid ref: ${{ github.ref }}"
exit 1
Expand Down
34 changes: 31 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
- "v*"

jobs:
build_backend:
backend_dist:
runs-on: ubuntu-24.04
permissions:
contents: read
Expand Down Expand Up @@ -47,7 +47,34 @@ jobs:
path: |
./backend/target/billtracker-backend-1.0.0.jar
build_frontend:
backend_oci_image:
runs-on: ubuntu-24.04
defaults:
run:
working-directory: ./frontend
steps:
- uses: actions/checkout@v4

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.ACCESS_TOKEN }}

- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: ./backend
push: true
tags: ghcr.io/kerosene-labs/billtracker-backend:${{ env.TARGET }}
cache-from: type=gha
cache-to: type=gha,mode=max

frontend_dist:
runs-on: ubuntu-24.04
permissions:
contents: read
Expand Down Expand Up @@ -82,4 +109,5 @@ jobs:
uses: actions/upload-artifact@v4
with:
name: frontend
path: build
path: build

0 comments on commit d85ab1a

Please sign in to comment.