-
Notifications
You must be signed in to change notification settings - Fork 3
117 lines (113 loc) · 3.73 KB
/
release-please.yaml
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
name: Release Please
on:
push:
branches:
- main
permissions:
contents: write
pull-requests: write
jobs:
release-please:
runs-on: ubuntu-latest
outputs:
releases_created: ${{ steps.release.outputs.releases_created }}
release_version: ${{ steps.release.outputs.version }}
tag_name: ${{ steps.release.outputs.tag_name }}
steps:
- uses: googleapis/release-please-action@v4
id: release
with:
token: ${{ secrets.GITHUB_TOKEN }}
config-file: release-please-config.json
manifest-file: .release-please-manifest.json
publish-tag:
if: ${{ fromJSON(needs.release-please.outputs.releases_created) }}
runs-on: ubuntu-latest
needs: [release-please]
permissions:
packages: write
contents: read
steps:
- uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: ghcr.io/${{ github.repository }}
tags: |
type=raw,pattern={{version}},value=${{ needs.release-please.outputs.tag_name }}
- name: Build and push Docker image tag
uses: docker/build-push-action@v6
with:
context: .
platforms: linux/amd64, linux/arm64
file: Dockerfile
push: true
build-args: |
BUILD_VERSION="${{ needs.release-please.outputs.tag_name }}"
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
- name: Build dependencies Helm - nidhogg
uses: WyriHaximus/github-action-helm3@v4
with:
exec: helm dependency build charts/nidhogg
- name: Chart | Push - nidhogg
uses: appany/[email protected]
with:
name: nidhogg
repository: pelotech/charts
tag: ${{ needs.release-please.outputs.release_version }}
registry: ghcr.io
registry_username: ${{ github.actor }}
registry_password: ${{ secrets.github_token }}
publish-dev:
if: ${{ ! fromJSON(needs.release-please.outputs.releases_created) }}
runs-on: ubuntu-latest
needs: [release-please]
permissions:
packages: write
contents: read
steps:
- uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to the Container registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: ghcr.io/${{ github.repository }}
tags: |
# set latest tag for default branch
type=raw,value=latest,enable={{is_default_branch}}
- name: sha short
id: sha
run: echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
- name: Build and push Docker image sha
uses: docker/build-push-action@v6
with:
context: .
platforms: linux/amd64, linux/arm64
file: Dockerfile
push: true
build-args: |
BUILD_VERSION=${{ steps.sha.outputs.sha_short }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}