summary refs log tree commit diff
path: root/.github/workflows
diff options
context:
space:
mode:
authorCyberL1 <mateusz.hf18@gmail.com>2026-02-11 08:28:40 +0100
committerCyberL1 <mateusz.hf18@gmail.com>2026-02-11 08:28:40 +0100
commitbde7245ce14512843924f974a787a7cca91c1798 (patch)
tree2f8a321b786400cb666d412dc150d8b564a36261 /.github/workflows
parentDevshell: add python setuptools (diff)
downloadserver-ts-bde7245ce14512843924f974a787a7cca91c1798.tar.xz
chore: merge docker build workflows into one
Diffstat (limited to '.github/workflows')
-rw-r--r--.github/workflows/build-docker.yml54
1 files changed, 54 insertions, 0 deletions
diff --git a/.github/workflows/build-docker.yml b/.github/workflows/build-docker.yml
new file mode 100644

index 00000000..ae1cdcf0 --- /dev/null +++ b/.github/workflows/build-docker.yml
@@ -0,0 +1,54 @@ +name: Build docker images + +on: + push: + branches: + - master + +jobs: + build: + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + strategy: + matrix: + package: + - default + - cdn + - api + - gateway + - admin-api + - cdn-cs + - gateway-offload + steps: + - uses: cachix/install-nix-action@v31 + with: + nix_path: nixpkgs=channel:nixos-unstable + - name: Clone the server repository + run: git clone https://github.com/spacebarchat/server + - name: Build the docker image + run: nix build .#containers.x86_64-linux.docker.${{ matrix.package }} + working-directory: server + - run: docker load < result + working-directory: server + - name: downcase REPO + run: echo "REPO=${GITHUB_REPOSITORY,,}" >>${GITHUB_ENV} + - name: Log in to the Container registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Compute image suffix + run: | + if [ "${{ matrix.package }}" = "default" ]; then + echo "SUFFIX=" >> $GITHUB_ENV + else + echo "SUFFIX=-${{ matrix.package }}" >> $GITHUB_ENV + fi + - name: Tag and push the image + run: | + IMAGE_ID=$(docker images spacebar-server-ts$SUFFIX --format '{{.ID}}') + docker tag $IMAGE_ID ghcr.io/$REPO$SUFFIX:latest + docker push ghcr.io/$REPO$SUFFIX:latest