Skip to content

Commit 6dbf646

Browse files
committed
Split out website builds for edge and release versions
So these can be deployed to separate .silverbullet.md subdomains later
1 parent 495bd8e commit 6dbf646

File tree

3 files changed

+66
-7
lines changed

3 files changed

+66
-7
lines changed
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: Docker Website (Manual)
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
tag:
7+
description: "Website image tag to build"
8+
required: true
9+
default: "edge"
10+
type: choice
11+
options:
12+
- edge
13+
- latest
14+
base_image:
15+
description: "Base SilverBullet image (e.g. zefhemel/silverbullet:v2)"
16+
required: true
17+
default: "zefhemel/silverbullet:v2"
18+
19+
env:
20+
WEBSITE_IMAGE: zefhemel/silverbullet-website
21+
22+
jobs:
23+
docker-website:
24+
runs-on: ubuntu-latest
25+
26+
steps:
27+
- name: Setup repo
28+
uses: actions/checkout@v3
29+
30+
- name: Login to Docker Hub
31+
uses: docker/login-action@v2
32+
with:
33+
username: ${{ secrets.DOCKERHUB_USERNAME }}
34+
password: ${{ secrets.DOCKERHUB_TOKEN }}
35+
36+
- name: "Website: Build and push"
37+
uses: docker/build-push-action@v6.18.0
38+
with:
39+
context: .
40+
file: Dockerfile.website
41+
push: true
42+
provenance: false
43+
build-args: |
44+
BASE_IMAGE=${{ inputs.base_image }}
45+
tags: ${{ env.WEBSITE_IMAGE }}:${{ inputs.tag }}

.github/workflows/docker.yml

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,21 @@ jobs:
121121
cache-from: type=gha
122122
cache-to: type=gha,mode=max
123123

124+
docker-website:
125+
runs-on: ubuntu-latest
126+
# Wait for main image so the base image is available (especially for release tags)
127+
needs: docker-main
128+
129+
steps:
130+
- name: Setup repo
131+
uses: actions/checkout@v3
132+
133+
- name: Login to Docker Hub
134+
uses: docker/login-action@v2
135+
with:
136+
username: ${{ secrets.DOCKERHUB_USERNAME }}
137+
password: ${{ secrets.DOCKERHUB_TOKEN }}
138+
124139
- name: "Website: Extract metadata (tags, labels) for docker"
125140
id: website_meta
126141
uses: docker/metadata-action@v4.4.0
@@ -129,17 +144,15 @@ jobs:
129144
tags: |
130145
type=edge,branch=main
131146
type=semver,pattern=latest,enable=true
132-
type=semver,pattern=latest,enable=true
133147
134-
- name: "Website: Build and push website docker images"
135-
uses: docker/build-push-action@v4.0.0
148+
- name: "Website: Build and push"
149+
uses: docker/build-push-action@v6.18.0
136150
with:
137151
context: .
138152
file: Dockerfile.website
139-
platforms: ${{ env.ARCHITECTURES }}
140153
push: true
141154
provenance: false
155+
build-args: |
156+
BASE_IMAGE=zefhemel/silverbullet:${{ startsWith(github.ref, 'refs/tags/') && 'latest' || 'v2' }}
142157
tags: ${{ steps.website_meta.outputs.tags }}
143158
labels: ${{ steps.website_meta.outputs.labels }}
144-
cache-from: type=gha
145-
cache-to: type=gha,mode=max

Dockerfile.website

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
FROM zefhemel/silverbullet:v2
1+
ARG BASE_IMAGE=zefhemel/silverbullet:v2
2+
FROM ${BASE_IMAGE}
23

34
# Set some environment variables
45
ENV SB_INDEX_PAGE=SilverBullet

0 commit comments

Comments
 (0)