-
Notifications
You must be signed in to change notification settings - Fork 6
94 lines (80 loc) · 2.76 KB
/
release.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
name: Release Charts
on:
push:
branches:
- main
workflow_dispatch:
inputs:
release-charts-to-acr:
description: Release the Helm charts to ACR
required: false
default: 'false'
jobs:
release:
permissions:
contents: write
runs-on: ubuntu-latest
if: ${{ github.repository == 'GreptimeTeam/helm-charts' }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Configure Git
run: |
git config user.name "$GITHUB_ACTOR"
git config user.email "[email protected]"
- name: Install Helm
uses: azure/[email protected]
- name: Add Dependencies
run: |
helm repo add grafana https://grafana.github.io/helm-charts
helm repo add jaeger-all-in-one https://raw.githubusercontent.com/hansehe/jaeger-all-in-one/master/helm/charts/
- name: Run chart-releaser
uses: helm/[email protected]
with:
charts_dir: charts
env:
CR_SKIP_EXISTING: true
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
release-charts-to-acr:
runs-on: ubuntu-latest
if: ${{ github.repository == 'GreptimeTeam/helm-charts' && (inputs.release-charts-to-acr == 'true' || github.event_name == 'push') }}
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Set up Helm
uses: azure/[email protected]
- name: Login to OCI registry
run: echo '${{ secrets.ALICLOUD_PASSWORD }}' | helm registry login ${{ vars.OCI_REGISTRY_URL }} -u ${{ secrets.ALICLOUD_USERNAME }} --password-stdin
- name: Package and push Helm Charts
shell: bash
env:
OCI_REGISTRY_URL: ${{ vars.OCI_REGISTRY_URL }}
OCI_NAMESPACE: ${{ vars.OCI_NAMESPACE }}
run: |
./scripts/release/release-charts-to-acr.sh
release-charts-to-s3:
needs: [
release,
]
runs-on: ubuntu-latest
steps:
# TODO(zyy17): Maybe it's not a elegant way to wait for GitHub Pages to update. For many scenarios, waiting for 5 minutes is enough.
- name: Wait for deployment of GitHub Pages
run: |
sleep 300
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v2
with:
aws-access-key-id: ${{ secrets.AWS_CN_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_CN_SECRET_ACCESS_KEY }}
aws-region: ${{ vars.AWS_RELEASE_BUCKET_REGION }}
- name: Release charts to S3
shell: bash
run: |
./scripts/release/release-charts-to-s3.sh ${{ vars.AWS_RELEASE_BUCKET }}