From c50b99abe3b3d37f6c2a6c124c84dedf37ce1069 Mon Sep 17 00:00:00 2001 From: LuisMSuarez <140195810+LuisMSuarez@users.noreply.github.com> Date: Thu, 18 Sep 2025 13:22:06 -0700 Subject: [PATCH 1/2] Build and publish container image --- .github/workflows/CI-build.yml | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/.github/workflows/CI-build.yml b/.github/workflows/CI-build.yml index bdd7b02..2cb721f 100644 --- a/.github/workflows/CI-build.yml +++ b/.github/workflows/CI-build.yml @@ -4,9 +4,15 @@ on: push: pull_request: +env: + REGISTRY: ghcr.io + jobs: build: runs-on: ubuntu-latest + permissions: + contents: read # Required for actions/checkout + packages: write # Required to publish docker image steps: - name: Checkout code @@ -34,3 +40,24 @@ jobs: with: name: server-app path: packages/server/dist + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Log in to GitHub container registry + uses: docker/login-action@v3 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ github.token }} + + - name: Lowercase the repo name and username as container tags must be lowercase + run: echo "REPO=${GITHUB_REPOSITORY,,}" >>${GITHUB_ENV} + + - name: Build and push container image to registry + id: push + uses: docker/build-push-action@v5 + with: + push: ${{ github.event_name == 'push' }} # always build the container (incl. Pull Requests), but only push to the registry on code push + tags: ${{ env.REGISTRY }}/${{ env.REPO }}:${{ github.sha }} + file: ./Dockerfile From 0aadbb3020866cf39b48c87af4a24912e095c859 Mon Sep 17 00:00:00 2001 From: LuisMSuarez <140195810+LuisMSuarez@users.noreply.github.com> Date: Thu, 18 Sep 2025 13:25:08 -0700 Subject: [PATCH 2/2] Update CI-build.yml --- .github/workflows/CI-build.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/CI-build.yml b/.github/workflows/CI-build.yml index 2cb721f..0fe097d 100644 --- a/.github/workflows/CI-build.yml +++ b/.github/workflows/CI-build.yml @@ -2,7 +2,9 @@ name: Build with Bun on: push: + branches: [master] pull_request: + branches: [master] env: REGISTRY: ghcr.io