-
Notifications
You must be signed in to change notification settings - Fork 12
93 lines (80 loc) · 2.49 KB
/
sync-extensions.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
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
name: Sync and Release Extensions
on:
release:
types: [released]
# Removing this trigger until the protected rule on the `main` branch does not limit actions.
push:
branches:
- main
paths:
- manifest.json
env:
ACTIONS_RUNNER_DEBUG: false
CI_COMMIT_MESSAGE: CI Build Artifacts
jobs:
sync-charts:
if: github.repository_owner == 'rancher' && github.ref_type != 'tag'
name: Sync and Release Extension Charts
runs-on: ubuntu-latest
permissions:
actions: write
contents: write
deployments: write
pages: write
steps:
- name: Checkout
uses: actions/checkout@v3
with:
token: ${{ secrets.BYPASS_TOKEN }}
- name: Configure Git
run: |
echo ${{ secrets.BYPASS_TOKEN }} | gh auth login --with-token
git config user.name github-actions[bot]
git config user.email github-actions[bot]@github.com
- name: Setup Helm
uses: azure/setup-helm@v3
with:
version: v3.12.1
- name: Run sync-charts script
shell: bash
id: sync_charts_script
run: |
chmod +x ./scripts/sync-charts
./scripts/sync-charts
- name: Commit build
run: |
git add ./{assets,charts,extensions,icons,index.yaml}
git commit -a -m "${{ env.CI_COMMIT_MESSAGE }}"
git push
- name: Run chart-releaser
uses: helm/[email protected]
with:
charts_dir: ./charts/*
env:
CR_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
CR_SKIP_EXISTING: true
sync-catalogs:
if: github.repository_owner == 'rancher' && github.ref_type == 'tag'
name: Sync and Release Extension Catalog
runs-on: ubuntu-latest
permissions:
actions: write
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Configure Git
run: |
git config user.name 'github-actions[bot]'
git config user.email 'github-actions[bot]@users.noreply.github.com'
- name: Login to Container Registry
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Sync Catalog Image with Registry
id: sync_catalog_script
run: |
chmod +x ./scripts/bundle-catalog
./scripts/bundle-catalog -t ${{ github.ref_name }}