Skip to content

Commit

Permalink
add manual workflow dispatch
Browse files Browse the repository at this point in the history
  • Loading branch information
Puyodead1 committed Aug 24, 2023
1 parent cccf4b0 commit bf7fbc6
Show file tree
Hide file tree
Showing 2 changed files with 69 additions and 21 deletions.
30 changes: 24 additions & 6 deletions .github/workflows/spacebar-client-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,28 @@ on:
branches: [ "master" ]
paths:
- 'spacebar-client/**'
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 ARM64'
required: true
default: true
type: boolean

jobs:
build-amd64:
runs-on: ubuntu-latest
#needs: build-arm64
if: ${{ inputs.amd }}
steps:
- uses: actions/checkout@v3
- name: Set up QEMU
Expand All @@ -31,19 +48,20 @@ jobs:
context: "{{defaultContext}}:spacebar-client/"
platforms: linux/amd64
file: Dockerfile
push: ${{ github.event_name == 'push' }}
push: ${{ github.event_name == 'push' || (github.event_name == 'workflow_dispatch' && inputs.push) }}
tags: spacebarchat/client:latest-amd64
provenance: false
- name: Create and push manifest images
uses: Noelware/docker-manifest-action@master # or use a pinned version in the Releases tab
uses: Noelware/docker-manifest-action@master
with:
inputs: spacebarchat/client:latest
images: spacebarchat/client:latest-amd64
push: ${{ github.event_name == 'push' }}
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@v3
- name: Set up QEMU
Expand All @@ -61,7 +79,7 @@ jobs:
context: "{{defaultContext}}:spacebar-client/"
platforms: linux/arm/v7
file: Dockerfile
push: ${{ github.event_name == 'push' }}
push: ${{ github.event_name == 'push' || (github.event_name == 'workflow_dispatch' && inputs.push) }}
tags: spacebarchat/client:latest-armv7
provenance: false
- name: Build and push arm64
Expand All @@ -70,6 +88,6 @@ jobs:
context: "{{defaultContext}}:spacebar-client/"
platforms: linux/arm64
file: Dockerfile
push: ${{ github.event_name == 'push' }}
push: ${{ github.event_name == 'push' || (github.event_name == 'workflow_dispatch' && inputs.push) }}
tags: spacebarchat/client:latest-arm64
provenance: false
60 changes: 45 additions & 15 deletions .github/workflows/spacebar-server-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,38 @@ on:
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
#needs: build-arm64
if: ${{ inputs.amd }}
steps:
- uses: actions/checkout@v3
- name: Set up QEMU
Expand All @@ -25,40 +52,41 @@ jobs:
with:
username: ${{ secrets.DOCKERHUB_SPACEBAR_USERNAME }}
password: ${{ secrets.DOCKERHUB_SPACEBAR_TOKEN }}
- name: Build and push with postgressql
- 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' }}
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 sqlite
- 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' }}
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
uses: Noelware/docker-manifest-action@master # or use a pinned version in the Releases tab
- 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' }}
push: ${{ github.event_name == 'push' || (github.event_name == 'workflow_dispatch' && inputs.push) }}
amend: true
- name: Create and push manifest images sqlite
uses: Noelware/docker-manifest-action@master # or use a pinned version in the Releases tab
- 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' }}
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@v3
- name: Set up QEMU
Expand All @@ -70,21 +98,23 @@ jobs:
with:
username: ${{ secrets.DOCKERHUB_SPACEBAR_USERNAME }}
password: ${{ secrets.DOCKERHUB_SPACEBAR_TOKEN }}
- name: Build and push with sqlite arm64
- 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' }}
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
- 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' }}
push: ${{ github.event_name == 'push' || (github.event_name == 'workflow_dispatch' && inputs.push) }}
tags: spacebarchat/server:latest-postgressql-arm64
provenance: false

0 comments on commit bf7fbc6

Please sign in to comment.