-
Notifications
You must be signed in to change notification settings - Fork 0
56 lines (49 loc) · 1.72 KB
/
publish-package.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
name: Publish Package
on:
push:
tags:
- "[0-9]+.[0-9]+.[0-9]+"
- "[0-9]+.[0-9]+.[0-9]+-alpha.[0-9]+"
- "[0-9]+.[0-9]+.[0-9]+-beta.[0-9]+"
- "[0-9]+.[0-9]+.[0-9]+-rc.[0-9]+"
branches:
- main
workflow_dispatch:
jobs:
publish-package:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Install Carvel tools
shell: bash
run: curl -L https://carvel.dev/install.sh | bash
- name: Calculate variables
shell: bash
run: |
REPOSITORY_OWNER=${{github.repository_owner}}
echo "REPOSITORY_OWNER=${REPOSITORY_OWNER,,}" >>${GITHUB_ENV}
echo "REPOSITORY_TAG=${GITHUB_REF##*/}" >>${GITHUB_ENV}
echo "REPOSITORY_SHA_TAG=sha-${GITHUB_SHA::7}" >>${GITHUB_ENV}
- name: Create publish values file
shell: bash
run: |
cat <<EOF > publish-values.yaml
clusterIngress:
caCertificateRef:
namespace: default
name: ca-certificate
EOF
- name: Publish package bundle
shell: bash
run: |
# Create images lock file. We use a sample values file to pass validations
# We properly rewrite references to images via kbld
ytt --data-values-file publish-values.yaml -f bundle/config | \
kbld -f - --imgpkg-lock-output bundle/.imgpkg/images.yml
# Push the bundle to the registry
imgpkg push \
-b ghcr.io/${{env.REPOSITORY_OWNER}}/educates-lookup-service-installer:${{env.REPOSITORY_TAG}} \
--registry-username=${{github.actor}} \
--registry-password=${{secrets.GITHUB_TOKEN}} \
-f bundle