This repository has been archived by the owner on Oct 5, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
57 lines (47 loc) · 1.51 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
name: Docker
on:
push:
paths-ignore:
- '**.md'
branches:
- master
- dev
release:
types:
- published
workflow_dispatch:
env:
DOCKER_BASE_NAME: ghcr.io/slashnephy/saya
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Setup QEMU user-mode emulation
uses: docker/setup-qemu-action@v2
- name: Setup Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Prepare image tag (master)
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
run: echo "DOCKER_TAG=latest" >> $GITHUB_ENV
- name: Prepare image tag (dev)
if: github.event_name == 'push' && github.ref == 'refs/heads/dev'
run: echo "DOCKER_TAG=dev" >> $GITHUB_ENV
- name: Prepare image tag (Release)
if: github.event_name == 'release'
run: echo "DOCKER_TAG=${{ github.event.release.tag_name }}" >> $GITHUB_ENV
- name: Build & Push
uses: docker/build-push-action@v3
with:
push: true
platforms: linux/amd64,linux/arm/v7,linux/arm64/v8,linux/ppc64le,linux/s390x
tags: ${{ env.DOCKER_BASE_NAME }}:${{ env.DOCKER_TAG }}
cache-from: type=gha
cache-to: type=gha,mode=max