Bump node from 18-alpine to 21-alpine in /spacebar-server #22
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build spacebar Server docker image | |
on: | |
push: | |
branches: ["master"] | |
paths: | |
- "spacebar-server/**" | |
pull_request: | |
branches: ["master"] | |
paths: | |
- "spacebar-server/**" | |
workflow_dispatch: | |
inputs: | |
push: | |
description: "Push to Docker Hub" | |
required: true | |
default: false | |
type: boolean | |
arm: | |
description: "Build ARM64" | |
required: true | |
default: true | |
type: boolean | |
amd: | |
description: "Build AMD64" | |
required: true | |
default: true | |
type: boolean | |
sqlite: | |
description: "Build SQLite3" | |
required: false | |
default: true | |
type: boolean | |
postgresql: | |
description: "Build PostgresSQL" | |
required: false | |
default: true | |
type: boolean | |
jobs: | |
build-amd64: | |
runs-on: ubuntu-latest | |
if: ${{ inputs.amd }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v2 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Login to Docker Hub | |
uses: docker/login-action@v2 | |
with: | |
username: ${{ secrets.DOCKERHUB_SPACEBAR_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_SPACEBAR_TOKEN }} | |
- name: Build and push with PostgresSQL AMD64 | |
uses: docker/build-push-action@v4 | |
with: | |
context: "{{defaultContext}}:spacebar-server/" | |
platforms: linux/amd64 | |
file: Dockerfile-prod | |
push: ${{ github.event_name == 'push' || (github.event_name == 'workflow_dispatch' && inputs.push) }} | |
tags: spacebarchat/server:latest-postgressql-amd64 | |
provenance: false | |
- name: Build and push with SQLite3 AMD64 | |
uses: docker/build-push-action@v4 | |
with: | |
context: "{{defaultContext}}:spacebar-server/" | |
file: Dockerfile | |
push: ${{ github.event_name == 'push' || (github.event_name == 'workflow_dispatch' && inputs.push) }} | |
tags: spacebarchat/server:latest-sqlite-amd64 | |
provenance: false | |
- name: Create and push manifest images PostgresSQL AMD64 | |
uses: Noelware/docker-manifest-action@master | |
with: | |
inputs: spacebarchat/server:latest-postgressql | |
images: spacebarchat/server:latest-postgressql-amd64 | |
push: ${{ github.event_name == 'push' || (github.event_name == 'workflow_dispatch' && inputs.push) }} | |
amend: true | |
- name: Create and push manifest images SQLite3 AMD64 | |
uses: Noelware/docker-manifest-action@master | |
with: | |
inputs: spacebarchat/server:latest-sqlite | |
images: spacebarchat/server:latest-sqlite-amd64 | |
push: ${{ github.event_name == 'push' || (github.event_name == 'workflow_dispatch' && inputs.push) }} | |
amend: true | |
build-arm64: | |
runs-on: [self-hosted, arm64] | |
if: ${{ inputs.arm }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v2 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Login to Docker Hub | |
uses: docker/login-action@v2 | |
with: | |
username: ${{ secrets.DOCKERHUB_SPACEBAR_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_SPACEBAR_TOKEN }} | |
- name: Build and push with SQLite3 ARM64 | |
if: ${{ inputs.sqlite }} | |
uses: docker/build-push-action@v4 | |
with: | |
context: "{{defaultContext}}:spacebar-server/" | |
platforms: linux/arm64 | |
file: Dockerfile | |
push: ${{ github.event_name == 'push' || (github.event_name == 'workflow_dispatch' && inputs.push) }} | |
tags: spacebarchat/server:latest-sqlite-arm64 | |
provenance: false | |
- name: Build and push with PostgresSQL ARM64 | |
if: ${{ inputs.postgresql }} | |
uses: docker/build-push-action@v4 | |
with: | |
context: "{{defaultContext}}:spacebar-server/" | |
platforms: linux/arm64 | |
file: Dockerfile-prod | |
push: ${{ github.event_name == 'push' || (github.event_name == 'workflow_dispatch' && inputs.push) }} | |
tags: spacebarchat/server:latest-postgressql-arm64 | |
provenance: false |