@@ -44,14 +44,16 @@ jobs:
4444 if : always()
4545 run : time deno test
4646
47- # Push image to GitHub Packages.
48- # See also https://docs.docker.com/docker-hub/builds/
4947 push :
5048 needs : check
5149 runs-on : ubuntu-latest
5250 name : ' Push container image'
5351 if : github.event_name == 'push'
5452
53+ permissions :
54+ contents : read
55+ packages : write
56+
5557 steps :
5658 - name : Use Deno
5759 uses : denoland/setup-deno@v2
@@ -67,14 +69,11 @@ jobs:
6769 - name : Determine image name
6870 id : name
6971 run : |
70- IMAGE_ID=ghcr.io/cloudydeno/dns-sync
71- IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]')
7272 if [[ "${{ github.ref }}" == "refs/tags/"* ]]
7373 then VERSION=$( echo $VERSION | sed -e 's/^v//' )
7474 else VERSION=$( echo ${{ github.sha }} | cut -c1-7 )
7575 fi
76- echo "Will push to $IMAGE_ID:$VERSION"
77- echo "::set-output name=image::$IMAGE_ID"
76+ echo "Will push tag $VERSION"
7877 echo "::set-output name=tag::$VERSION"
7978
8079 - name : Log into GitHub Container Registry
8887
8988 - name : Build denodir
9089 run : deno task doci pipeline build
91- # - name: Push denodir image
92- # run: deno task doci pipeline push --tag ${{ steps.name.outputs.tag }} --target denodir
9390 - name : Push alpine image
9491 run : deno task doci pipeline push --tag ${{ steps.name.outputs.tag }} --target alpine
92+
93+ check-chart :
94+ runs-on : ubuntu-latest
95+ name : Check Helm chart
96+
97+ steps :
98+ - name : Checkout source
99+ uses : actions/checkout@v5
100+
101+ - name : Install Helm
102+ uses : azure/setup-helm@v4
103+ with :
104+ token : ${{ secrets.GITHUB_TOKEN }}
105+
106+ - name : Evaluate Chart
107+ run : time helm template helm-chart
108+
109+ push-chart :
110+ needs :
111+ - push
112+ - check-chart
113+ runs-on : ubuntu-latest
114+ name : ' Push Helm chart'
115+ if : github.event_name == 'push'
116+
117+ permissions :
118+ contents : read
119+ packages : write
120+
121+ steps :
122+ - name : Checkout
123+ uses : actions/checkout@v5
124+
125+ - name : Determine image tag
126+ id : name
127+ run : |
128+ if [[ "${{ github.ref }}" == "refs/tags/"* ]]
129+ then VERSION=$( echo $VERSION | sed -e 's/^v//' )
130+ else VERSION=$( echo ${{ github.sha }} | cut -c1-7 )
131+ fi
132+ echo "Will push tag $VERSION"
133+ echo "tag=$VERSION" >> $GITHUB_OUTPUT
134+
135+ - name : Install Helm
136+ uses : azure/setup-helm@v4
137+ with :
138+ token : ${{ secrets.GITHUB_TOKEN }}
139+
140+ - name : Login to GitHub Container Registry
141+ run : echo "${GITHUB_TOKEN}" | helm registry login ghcr.io --username ${GITHUB_ACTOR} --password-stdin
142+ env :
143+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
144+
145+ - name : Package chart
146+ working-directory : helm-chart
147+ run : helm package . -u -d dist --app-version "${{ steps.name.outputs.tag }}"
148+
149+ - name : Push chart
150+ working-directory : helm-chart
151+ run : helm push dist/*.tgz oci://ghcr.io/cloudydeno/charts
0 commit comments