forked from lyzhang1999/code-server-operator
-
Notifications
You must be signed in to change notification settings - Fork 0
82 lines (70 loc) · 2.86 KB
/
release.yaml
File metadata and controls
82 lines (70 loc) · 2.86 KB
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
name: Release
on:
release:
types: [published]
jobs:
image-build:
name: Build Docker Image
runs-on: ubuntu-latest
steps:
- name: Check out
uses: actions/checkout@v6
- name: Login to GitHub Container Registry
uses: docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef # v3.6.0
with:
registry: ghcr.io
username: walnuts1018
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # v3.12.0
with:
version: latest
- name: Get Tag from Release
run: echo "ImageTag=${GITHUB_REF##*/}" >> $GITHUB_ENV
- name: Build and push Docker images
uses: docker/build-push-action@bcafcacb16a39f128d818304e6c9c0c18556b85f # v7.1.0
with:
push: true
context: .
platforms: linux/amd64,linux/arm64
cache-from: type=gha
cache-to: type=gha,mode=max
build-args: TARGETOS=linux
tags: |
ghcr.io/walnuts1018/code-server-operator:latest
ghcr.io/walnuts1018/code-server-operator:${{ github.event.release.tag_name }}
chart-release:
runs-on: ubuntu-latest
needs: image-build
if: ${{ success() }}
steps:
- name: Checkout
uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Set chart version
run: |
sed --in-place "s/version-placeholder/${{ github.event.release.tag_name }}/g" charts/code-server-operator/Chart.yaml
sed --in-place "s/version-placeholder/${{ github.event.release.tag_name }}/g" charts/code-server-operator/Chart.yaml
sed --in-place "s/latest/${{ github.event.release.tag_name }}/g" charts/code-server-operator/values.yaml
sed --in-place "s/repository: controller/repository: ghcr.io\/walnuts1018\/code-server-operator/g" charts/code-server-operator/values.yaml
- name: Create release notes
run: |
# Helm Chart のリリースノートには、本体のリリースへのリンクを追加する
tag_version=${GITHUB_REF##*/}
cat <<EOF > ./charts/code-server-operator/RELEASE.md
Helm chart [$tag_version](https://github.com/walnuts1018/code-server-operator/releases/tag/$tag_version)
EOF
- name: Configure Git
run: |
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
- name: Install Helm
uses: azure/setup-helm@1a275c3b69536ee54be43f2070a358922e12c8d4 # v4.3.1
- name: Run chart-releaser
uses: helm/chart-releaser-action@cae68fefc6b5f367a0275617c9f83181ba54714f # v1.7.0
with:
config: cr.yaml
env:
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}"