-
Notifications
You must be signed in to change notification settings - Fork 12
120 lines (117 loc) · 4.17 KB
/
spacebar-server-docker.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
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