-
Notifications
You must be signed in to change notification settings - Fork 12
65 lines (63 loc) · 2 KB
/
release.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
---
name: release
on:
release:
types:
- published
schedule:
- cron: '45 5 * * *'
workflow_dispatch:
jobs:
build:
strategy:
matrix:
build_cmd:
- ./build-latest.sh
- PRERELEASE=true ./build-latest.sh
- ./build.sh main
platform:
- linux/amd64,linux/arm64
fail-fast: false
runs-on: ubuntu-latest
name: Build new Peering Manager Docker images
env:
GH_ACTION: enable
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
IMAGE_NAMES: docker.io/peeringmanager/peering-manager ghcr.io/peering-manager/peering-manager
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Get version of Peering Manager Docker
run: echo "version=$(cat VERSION)" >>"$GITHUB_OUTPUT"
shell: bash
- name: Check if the build is needed for '${{ matrix.build_cmd }}'
id: check-build-needed
env:
CHECK_ONLY: "true"
run: ${{ matrix.build_cmd }}
- name: Set up Docker Buildx
id: buildx-setup
uses: docker/setup-buildx-action@v3
if: steps.check-build-needed.outputs.skipped != 'true'
# docker.io
- name: Login to docker.io
uses: docker/login-action@v3
with:
registry: docker.io
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
if: steps.check-build-needed.outputs.skipped != 'true'
# ghcr.io
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
if: steps.check-build-needed.outputs.skipped != 'true'
- name: Push the image
run: ${{ matrix.build_cmd }} --push
if: steps.check-build-needed.outputs.skipped != 'true'
env:
BUILDX_PLATFORM: ${{ matrix.platform }}
BUILDX_BUILDER_NAME: ${{ steps.buildx-setup.outputs.name }}