-
Notifications
You must be signed in to change notification settings - Fork 23
87 lines (69 loc) · 3.03 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
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
name: Release Charts
on:
push:
branches:
- main
# Environment variables available to all jobs and steps in this workflow
env:
K3D_VERSION: 5.4.4
HELM_VERSION: 3.11.3
KUBECTL_VERSION: 1.23.4
KUSTOMIZE_VERSION: 4.5.7
jobs:
release:
# depending on default permission settings for your org (contents being read-only or read-write for workloads), you will have to add permissions
# see: https://docs.github.com/en/actions/security-guides/automatic-token-authentication#modifying-the-permissions-for-the-github_token
permissions:
contents: write
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Helm linting
run: |
./test/lint.sh
- name: Dependencies
run: |
mkdir -p ${GITHUB_WORKSPACE}/bin/
# install kubectl
curl -L https://storage.googleapis.com/kubernetes-release/release/v${KUBECTL_VERSION}/bin/linux/amd64/kubectl -o ${GITHUB_WORKSPACE}/bin/kubectl && chmod +x ${GITHUB_WORKSPACE}/bin/kubectl
# install helm
curl -L https://get.helm.sh/helm-v${HELM_VERSION}-linux-amd64.tar.gz -o helm-v${HELM_VERSION}-linux-amd64.tar.gz && tar -zxvf helm-v${HELM_VERSION}-linux-amd64.tar.gz && chmod +x linux-amd64/helm && mv linux-amd64/helm ${GITHUB_WORKSPACE}/bin/helm
# install kustomize
curl -L https://github.com/kubernetes-sigs/kustomize/releases/download/kustomize%2Fv${KUSTOMIZE_VERSION}/kustomize_v${KUSTOMIZE_VERSION}_linux_amd64.tar.gz -o kustomize_v${KUSTOMIZE_VERSION}_linux_amd64.tar.gz && tar -zxvf kustomize_v${KUSTOMIZE_VERSION}_linux_amd64.tar.gz && chmod +x kustomize && mv kustomize ${GITHUB_WORKSPACE}/bin/kustomize
# install k3d
curl -s https://raw.githubusercontent.com/rancher/k3d/main/install.sh | TAG=v${K3D_VERSION} bash
# install taskfile
curl -sL https://taskfile.dev/install.sh | sh
# install yq
sudo snap install yq
- name: GitHub Path
run: |
echo "$GITHUB_WORKSPACE/bin" >> $GITHUB_PATH
- name: Create Kubernetes Cluster
run: |
k3d cluster create --config=cluster/config.yaml
- name: Test Drupal Helm Chart
run: |
cd charts/drupal
helm install drupal -f values.yaml . --timeout=600s
- name: Configure Git
run: |
git config user.name "chart-releaser"
git config user.email "[email protected]"
- name: Install Helm
uses: azure/setup-helm@v1
with:
version: v3.8.1
- name: Add repositories
run: |
for repo in $(yq '.chart-repos[]' test/config.yaml); do helm repo add $(echo $repo | cut -d'=' -f1) $(echo $repo | cut -d'=' -f2) --force-update; done
- name: Run chart-releaser
uses: helm/[email protected]
with:
charts_dir: ./charts
env:
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
CR_SKIP_EXISTING: 'true'