Skip to content

Commit

Permalink
Add workflow to build app
Browse files Browse the repository at this point in the history
  • Loading branch information
gunndabad committed Nov 14, 2024
1 parent b8e020f commit 7f68555
Showing 1 changed file with 41 additions and 0 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Build

on:
push:
branches:
- main

jobs:
build:
runs-on: ubuntu-latest
env:
CONTAINER_REGISTRY: ghcr.io

steps:
- uses: actions/checkout@v4

- name: Build app
run: |
cd app
yarn install --immutable
yarn tsc
yarn build:backend --config ../../app-config.yaml --config ../../app-config.production.yaml
- name: Get Docker image tag
id: image_tags
run: |
echo "tag=$CONTAINER_REGISTRY/$(echo $GITHUB_REPOSITORY | tr '[:upper:]' '[:lower:]'):$GITHUB_SHA" >> $GITHUB_OUTPUT
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ${{ env.CONTAINER_REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Docker build
run: |
cd app && docker build . --tag
docker push $TAG
env:
TAG: ${{ steps.image_tags.outputs.tag }}

0 comments on commit 7f68555

Please sign in to comment.