-
Notifications
You must be signed in to change notification settings - Fork 189
83 lines (75 loc) · 2.43 KB
/
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
name: Docker
on:
push:
branches:
- "main"
tags:
- "*"
env:
# Docker & Registries
ARCHITECTURES: linux/amd64,linux/arm64
IMAGE_NAME: silverbullet
NAMESPACE_GITHUB: silverbulletmd
NAMESPACE_DOCKER: zefhemel
jobs:
docker-main:
runs-on: ubuntu-latest
steps:
- name: Setup repo
uses: actions/checkout@v3
- name: Set up QEMU for multi-arch builds with buildx
uses: docker/setup-qemu-action@v2
with:
platforms: ${{ env.ARCHITECTURES }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
with:
platforms: ${{ env.ARCHITECTURES }}
- name: Setup Deno
uses: denoland/setup-deno@v1
with:
deno-version: v2.0.6
- name: Run bundle build
run: |
deno task build
deno task bundle
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Log in to the ghcr Container registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
#
# MetaData Extract Docu: <https://github.com/docker/metadata-action>
#
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/[email protected]
with:
images: |
# Set the different image names(paces) for docker-hub & ghcr
${{ env.NAMESPACE_DOCKER }}/${{ env.IMAGE_NAME }}
ghcr.io/${{ env.NAMESPACE_GITHUB }}/${{ env.IMAGE_NAME }}
tags: |
# When pushing a tag, release a tagged release :x.x.x
type=semver,pattern={{raw}},enable=true
# When pushing a tag (type=semver) push to :latest too
type=semver,pattern=latest,enable=true
# When pushing to main branch, release as :edge
type=edge,branch=main
- name: Build and push main docker images
uses: docker/[email protected]
with:
context: .
platforms: ${{ env.ARCHITECTURES }}
push: true
file: Dockerfile
# Disable to get rid of unknown architecture in ghcr
provenance: false
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}