-
Notifications
You must be signed in to change notification settings - Fork 13
59 lines (57 loc) · 1.72 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
---
name: release
on:
release:
types:
- published
schedule:
- cron: '45 5 * * *'
jobs:
build:
strategy:
matrix:
build_cmd:
- ./build-latest.sh
- ./build.sh main
fail-fast: false
runs-on: ubuntu-latest
name: Build new images
env:
GH_ACTION: enable
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Get version of Peering Manager Docker
run: echo "version=$(cat VERSION)" >>"$GITHUB_OUTPUT"
shell: bash
- id: docker-build
name: Build the image with '${{ matrix.build_cmd }}'
run: ${{ matrix.build_cmd }}
- name: Test the image
run: IMAGE="${FINAL_DOCKER_TAG}" ./test.sh
if: steps.docker-build.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.docker-build.outputs.skipped != 'true'
- name: Push the image to docker.io
run: ${{ matrix.build_cmd }} --push-only
if: steps.docker-build.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.docker-build.outputs.skipped != 'true'
- name: Push the image to ghcr.io
run: ${{ matrix.build_cmd }} --push
env:
DOCKER_REGISTRY: ghcr.io
DOCKER_ORG: peering-manager
if: steps.docker-build.outputs.skipped != 'true'