Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions .github/workflows/CI-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,19 @@ name: Build with Bun

on:
push:
branches: [master]
pull_request:
branches: [master]

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
Expand Down Expand Up @@ -34,3 +42,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