-
Notifications
You must be signed in to change notification settings - Fork 1
129 lines (116 loc) · 3.99 KB
/
ghcr-publish.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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
name: Build and Push to GHCR
on:
workflow_dispatch:
repository_dispatch:
types: [Build and Push to GHCR]
push:
branches:
- master
jobs:
build-and-push-to-ghcr:
runs-on: ubuntu-latest
steps:
- name: Get Short SHA
uses: benjlevesque/[email protected]
id: short-sha
with:
length: 7
- name: Checkout
uses: actions/[email protected]
- name: Log into GitHub Container Registry
run: echo "${{ secrets.GIT_TOKEN }}" | docker login https://ghcr.io -u ${{ github.actor }} --password-stdin
- name: Set up QEMU
uses: docker/[email protected]
with:
image: tonistiigi/binfmt:latest
platforms: all
- name: Set up Docker Buildx
uses: docker/[email protected]
with:
install: true
version: latest
driver-opts: image=moby/buildkit:master
- name: Build and push amd64
uses: docker/[email protected]
with:
context: ./
file: ./Dockerfile
push: true
provenance: false
tags: |
ghcr.io/${{ secrets.GIT_USER }}/restic-rclone:amd64
ghcr.io/${{ secrets.GIT_USER }}/restic-rclone:amd64_commit-${{ steps.short-sha.outputs.sha }}
platforms: linux/amd64
build-args: |
OVERLAY_ARCH=amd64
ARCH=amd64
- name: Build and push aarch64
uses: docker/[email protected]
with:
context: ./
file: ./Dockerfile
push: true
provenance: false
tags: |
ghcr.io/${{ secrets.GIT_USER }}/restic-rclone:arm64
ghcr.io/${{ secrets.GIT_USER }}/restic-rclone:arm64_commit-${{ steps.short-sha.outputs.sha }}
platforms: linux/arm64
build-args: |
OVERLAY_ARCH=aarch64
ARCH=arm64
- name: Build and push armv7
uses: docker/[email protected]
with:
context: ./
file: ./Dockerfile.armhf
push: true
provenance: false
tags: |
ghcr.io/${{ secrets.GIT_USER }}/restic-rclone:armhf
ghcr.io/${{ secrets.GIT_USER }}/restic-rclone:armhf_commit-${{ steps.short-sha.outputs.sha }}
platforms: linux/arm/v7
build-args: |
OVERLAY_ARCH=arm
ARCH=arm
RCLONE_ARCH=arm-v7
- name: Create and push manifest images
uses: Noelware/docker-manifest-action@master
with:
inputs: ghcr.io/${{ secrets.GIT_USER }}/restic-rclone:latest
images: ghcr.io/${{ secrets.GIT_USER }}/restic-rclone:amd64,ghcr.io/${{ secrets.GIT_USER }}/restic-rclone:arm64,ghcr.io/${{ secrets.GIT_USER }}/restic-rclone:armhf
push: true
- name: ntfy success notifications
uses: niniyas/ntfy-action@master
if: success()
with:
url: ${{ secrets.NTFY_URL }}
topic: ${{ secrets.NTFY_TOPIC }}
tags: github,action,+1,partying_face
priority: 4
image: true
actions: 'default'
details: 'Workflow has been completed successfully!'
headers: '${{ secrets.NTFY_HEADERS }}'
- name: ntfy failed notifications
uses: niniyas/ntfy-action@master
if: failure()
with:
url: ${{ secrets.NTFY_URL }}
topic: ${{ secrets.NTFY_TOPIC }}
tags: github,action,failed,rotating_light
priority: 5
image: true
actions: 'default'
details: 'Workflow has failed!'
headers: '${{ secrets.NTFY_HEADERS }}'
- name: ntfy cancelled notifications
uses: niniyas/ntfy-action@master
if: cancelled()
with:
url: ${{ secrets.NTFY_URL }}
topic: ${{ secrets.NTFY_TOPIC }}
tags: github,action,cancelled,skull
details: 'Workflow has been cancelled!'
headers: '${{ secrets.NTFY_HEADERS }}'
image: true
actions: 'default'