forked from mastodon/mastodon
-
Notifications
You must be signed in to change notification settings - Fork 6
90 lines (88 loc) · 2.72 KB
/
push_docker_image.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
name: Push our docker image
on:
push:
branches:
- hota/**
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
build-image:
name: Build docker image for mastodon
runs-on: ubuntu-latest
steps:
-
name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ secrets.REGISTRY_SERVER }}/${{ secrets.REGISTRY_REPO }}
tags: |
type=raw,value=latest,enable=${{ endsWith(github.ref, github.event.repository.default_branch) }}
type=ref,event=branch
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
-
name: Login to Docker Registry
uses: docker/login-action@v3
with:
registry: ${{ secrets.REGISTRY_SERVER }}
username: ${{ secrets.REGISTRY_USERNAME }}
password: ${{ secrets.REGISTRY_TOKEN }}
-
name: Checkout akane-blue/mastodon
uses: actions/checkout@v4
with:
repository: akane-blue/mastodon
path: mastodon
-
name: Build mastodon image
uses: docker/build-push-action@v5
with:
context: mastodon
file: mastodon/Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
build-streaming:
name: Build docker image for streaming
runs-on: ubuntu-latest
steps:
-
name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ secrets.REGISTRY_SERVER }}/${{ secrets.REGISTRY_REPO_STREAMING }}
tags: |
type=raw,value=latest,enable=${{ endsWith(github.ref, github.event.repository.default_branch) }}
type=ref,event=branch
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
-
name: Login to Docker Registry
uses: docker/login-action@v3
with:
registry: ${{ secrets.REGISTRY_SERVER }}
username: ${{ secrets.REGISTRY_USERNAME }}
password: ${{ secrets.REGISTRY_TOKEN }}
-
name: Checkout akane-blue/mastodon
uses: actions/checkout@v4
with:
repository: akane-blue/mastodon
path: mastodon
-
name: Build streaming image
uses: docker/build-push-action@v5
with:
context: mastodon
file: mastodon/streaming/Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max