-
Notifications
You must be signed in to change notification settings - Fork 1
75 lines (63 loc) · 2.02 KB
/
v3-container-build-push.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
name: v3 build and push
# This workflow is triggered by an update to the base image.
# When triggered the latest version of the container is built and pushed to docker hub
on:
workflow_dispatch:
jobs:
build_and_push:
name: v3 monthly build and push
runs-on: ubuntu-latest
permissions:
packages: write
contents: read
steps:
- name: Check out the repo
id: checkout
uses: actions/checkout@v4
- name: Set up QEMU
id: setup_qemu
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
id: setup_buildx
uses: docker/setup-buildx-action@v3
- name: Log in to Docker Hub
id: authenticate_dockerhub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Log in to the ghcr.io
id: authenticate_ghcr
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: extract_metadata
uses: docker/metadata-action@v5
with:
images: |
hucknz/cumulusmx
ghcr.io/${{ github.repository }}
tags: |
type=raw,value=b3283
type=raw,value=v3
- name: Build and push Docker images
id: build_images
uses: docker/build-push-action@v5
with:
context: v3
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ steps.extract_metadata.outputs.tags }}
labels: ${{ steps.extract_metadata.outputs.labels }}
- name: Notify outcome
id: notify
if: always()
uses: sarisia/actions-status-discord@v1
with:
webhook: ${{ secrets.DISCORD_WEBHOOK }}
noprefix: true
status: ${{ job.status }}
title: ${{ github.workflow}} ${{ job.status }}