mirror of
https://github.com/spacebarchat/server.git
synced 2026-03-29 14:09:52 +00:00
Merge pull request #1498 from CyberL1/chore/merge-docker-build-workflows
This commit is contained in:
36
.github/workflows/build-docker-admin-api.yml
vendored
36
.github/workflows/build-docker-admin-api.yml
vendored
@@ -1,36 +0,0 @@
|
||||
name: Build admin api docker image
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
paths:
|
||||
- "extra/admin-api/Spacebar.AdminApi/**"
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: read
|
||||
packages: write
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
- uses: cachix/install-nix-action@v31
|
||||
with:
|
||||
nix_path: nixpkgs=channel:nixos-unstable
|
||||
- name: Build the docker image
|
||||
run: nix build .#containers.x86_64-linux.docker.admin-api
|
||||
- run: docker load < result
|
||||
- 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: Tag and push the image
|
||||
run: |
|
||||
IMAGE_ID=$(docker images spacebar-server-ts-admin-api --format '{{.ID}}')
|
||||
docker tag $IMAGE_ID ghcr.io/$REPO-admin-api
|
||||
docker push ghcr.io/$REPO-admin-api
|
||||
38
.github/workflows/build-docker-api.yml
vendored
38
.github/workflows/build-docker-api.yml
vendored
@@ -1,38 +0,0 @@
|
||||
name: Build api docker image
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
paths:
|
||||
- "src/api/**"
|
||||
- "src/schemas/**"
|
||||
- "src/util/**"
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: read
|
||||
packages: write
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
- uses: cachix/install-nix-action@v31
|
||||
with:
|
||||
nix_path: nixpkgs=channel:nixos-unstable
|
||||
- name: Build the docker image
|
||||
run: nix build .#containers.x86_64-linux.docker.api
|
||||
- run: docker load < result
|
||||
- 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: Tag and push the image
|
||||
run: |
|
||||
IMAGE_ID=$(docker images spacebar-server-ts-api --format '{{.ID}}')
|
||||
docker tag $IMAGE_ID ghcr.io/$REPO-api
|
||||
docker push ghcr.io/$REPO-api
|
||||
36
.github/workflows/build-docker-bundle.yml
vendored
36
.github/workflows/build-docker-bundle.yml
vendored
@@ -1,36 +0,0 @@
|
||||
name: Build bundle docker image
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
paths:
|
||||
- "src/**"
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: read
|
||||
packages: write
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
- uses: cachix/install-nix-action@v31
|
||||
with:
|
||||
nix_path: nixpkgs=channel:nixos-unstable
|
||||
- name: Build the docker image
|
||||
run: nix build .#containers.x86_64-linux.docker.default
|
||||
- run: docker load < result
|
||||
- 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: Tag and push the image
|
||||
run: |
|
||||
IMAGE_ID=$(docker images spacebar-server-ts --format '{{.ID}}')
|
||||
docker tag $IMAGE_ID ghcr.io/$REPO
|
||||
docker push ghcr.io/$REPO
|
||||
36
.github/workflows/build-docker-cdn-cs.yml
vendored
36
.github/workflows/build-docker-cdn-cs.yml
vendored
@@ -1,36 +0,0 @@
|
||||
name: Build cdn cs docker image
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
paths:
|
||||
- "extra/admin-api/Spacebar.Cdn/**"
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: read
|
||||
packages: write
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
- uses: cachix/install-nix-action@v31
|
||||
with:
|
||||
nix_path: nixpkgs=channel:nixos-unstable
|
||||
- name: Build the docker image
|
||||
run: nix build .#containers.x86_64-linux.docker.cdn-cs
|
||||
- run: docker load < result
|
||||
- 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: Tag and push the image
|
||||
run: |
|
||||
IMAGE_ID=$(docker images spacebar-server-ts-cdn-cs --format '{{.ID}}')
|
||||
docker tag $IMAGE_ID ghcr.io/$REPO-cdn-cs
|
||||
docker push ghcr.io/$REPO-cdn-cs
|
||||
38
.github/workflows/build-docker-cdn.yml
vendored
38
.github/workflows/build-docker-cdn.yml
vendored
@@ -1,38 +0,0 @@
|
||||
name: Build cdn docker image
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
paths:
|
||||
- "src/cdn/**"
|
||||
- "src/schemas/**"
|
||||
- "src/util/**"
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: read
|
||||
packages: write
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
- uses: cachix/install-nix-action@v31
|
||||
with:
|
||||
nix_path: nixpkgs=channel:nixos-unstable
|
||||
- name: Build the docker image
|
||||
run: nix build .#containers.x86_64-linux.docker.cdn
|
||||
- run: docker load < result
|
||||
- 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: Tag and push the image
|
||||
run: |
|
||||
IMAGE_ID=$(docker images spacebar-server-ts-cdn --format '{{.ID}}')
|
||||
docker tag $IMAGE_ID ghcr.io/$REPO-cdn
|
||||
docker push ghcr.io/$REPO-cdn
|
||||
@@ -1,36 +0,0 @@
|
||||
name: Build gateway offload docker image
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
paths:
|
||||
- "extra/admin-api/Spacebar.GatewayOffload/**"
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: read
|
||||
packages: write
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
- uses: cachix/install-nix-action@v31
|
||||
with:
|
||||
nix_path: nixpkgs=channel:nixos-unstable
|
||||
- name: Build the docker image
|
||||
run: nix build .#containers.x86_64-linux.docker.gateway-offload
|
||||
- run: docker load < result
|
||||
- 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: Tag and push the image
|
||||
run: |
|
||||
IMAGE_ID=$(docker images spacebar-server-ts-gateway-offload --format '{{.ID}}')
|
||||
docker tag $IMAGE_ID ghcr.io/$REPO-gateway-offload
|
||||
docker push ghcr.io/$REPO-gateway-offload
|
||||
38
.github/workflows/build-docker-gateway.yml
vendored
38
.github/workflows/build-docker-gateway.yml
vendored
@@ -1,38 +0,0 @@
|
||||
name: Build gateway docker image
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
paths:
|
||||
- "src/gateway/**"
|
||||
- "src/schemas/**"
|
||||
- "src/util/**"
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: read
|
||||
packages: write
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
- uses: cachix/install-nix-action@v31
|
||||
with:
|
||||
nix_path: nixpkgs=channel:nixos-unstable
|
||||
- name: Build the docker image
|
||||
run: nix build .#containers.x86_64-linux.docker.gateway
|
||||
- run: docker load < result
|
||||
- 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: Tag and push the image
|
||||
run: |
|
||||
IMAGE_ID=$(docker images spacebar-server-ts-gateway --format '{{.ID}}')
|
||||
docker tag $IMAGE_ID ghcr.io/$REPO-gateway
|
||||
docker push ghcr.io/$REPO-gateway
|
||||
53
.github/workflows/build-docker.yml
vendored
Normal file
53
.github/workflows/build-docker.yml
vendored
Normal file
@@ -0,0 +1,53 @@
|
||||
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: actions/checkout@v6
|
||||
- uses: cachix/install-nix-action@v31
|
||||
with:
|
||||
nix_path: nixpkgs=channel:nixos-unstable
|
||||
- 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
|
||||
Reference in New Issue
Block a user