forked from mastodon/mastodon
-
Notifications
You must be signed in to change notification settings - Fork 24
64 lines (54 loc) · 1.79 KB
/
docker-build.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
name: Build Universal Image
on:
push:
branches:
- main
jobs:
docker-build:
runs-on: ubuntu-latest
if: ${{ !contains(github.event.commits.*.message, '[skip ci]') && !contains(github.event.commits.*.message, '[ci skip]') }}
steps:
- name: 🔍 Checkout code
uses: actions/checkout@v2
- name: 🦄 Set up Qemu for Docker
uses: docker/setup-qemu-action@v1
- name: 🏗️ Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: 🔑 Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: 🎃 Setup outputs
id: vars
run: |
echo "::set-output name=sha_short::$(git rev-parse --short HEAD)"
- name: 👻 Setup metadata
uses: docker/metadata-action@v3
id: meta
with:
images: mashirozx/mastodon
flavor: |
latest=auto
tags: |
type=edge,branch=main
type=match,pattern=v(.*),group=0
type=ref,event=pr
- name: ⚓ Build and push
uses: docker/build-push-action@v2
with:
context: .
pull: true
push: true
platforms: linux/amd64,linux/arm64
cache-from: type=registry,ref=mashirozx/mastodon:latest
cache-to: type=inline
tags: |
mashirozx/mastodon:latest
mashirozx/mastodon:sha-${{steps.vars.outputs.sha_short}}
- name: 🔖 Update repo description
uses: peter-evans/dockerhub-description@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
repository: mashirozx/mastodon