forked from cetic/helm-postgresql
-
Notifications
You must be signed in to change notification settings - Fork 0
60 lines (56 loc) · 1.77 KB
/
Copy pathpublish.yml
File metadata and controls
60 lines (56 loc) · 1.77 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
name: publish-postgresql-helm-chart
on:
push:
branches: ['master']
paths:
- 'templates/**'
- 'Chart.yaml'
jobs:
build-and-push-postgresql-helm-chart-to-ghcr:
name: Build and push PostgreSQL Helm chart to GHCR
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v4
- name: Install Helm
uses: azure/setup-helm@v4
- name: Package and upload chart
shell: bash
env:
REGISTRY: "ghcr.io"
REPOSITORY: "${{ github.repository }}"
TOKEN: "${{ secrets.GITHUB_TOKEN }}"
USER: "${{ github.repository_owner }}"
run: |
rm -rf dist
mkdir dist
helm package . -d dist/
echo "${TOKEN}" | helm registry login "${REGISTRY}/${REPOSITORY,,}" -u "${USER}" --password-stdin
helm push dist/*.tgz "oci://${REGISTRY}/${REPOSITORY,,}/charts"
build-and-push-postgresql-helm-chart-to-dockerhub:
name: Build and push PostgreSQL Helm chart to Docker Hub
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@v4
- name: Install Helm
uses: azure/setup-helm@v4
- name: Package chart
shell: bash
run: |
rm -rf dist
mkdir dist
helm package . -d dist/
- name: Login and push to Docker Hub
shell: bash
env:
REGISTRY: "docker.io"
USERNAME: "${{ secrets.DOCKER_HUB_USERNAME }}"
PASSWORD: "${{ secrets.DOCKER_HUB_PASSWORD }}"
NAMESPACE: "applause"
run: |
echo "${PASSWORD}" | helm registry login "${REGISTRY}" -u "${USERNAME}" --password-stdin
helm push dist/*.tgz "oci://${REGISTRY}/${NAMESPACE}"