Skip to content

chore(release): Release 0.20.9 (#3733) #1346

chore(release): Release 0.20.9 (#3733)

chore(release): Release 0.20.9 (#3733) #1346

Workflow file for this run

name: docker
on:
push:
branches: main
paths-ignore:
- "**.md"
- "docs/**"
- "website/**"
- "cdk.tf/**"
- "tools/update-github-project-board/**"
workflow_dispatch: {}
jobs:
build-docker-image:
if: github.repository == 'hashicorp/terraform-cdk'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@988b5a0280414f521da01fcc63a27aeeb4b104db # v3.6.1
- name: Cache Docker layers
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ hashFiles('/Dockerfile', '.terraform.versions.json') }}
restore-keys: |
${{ runner.os }}-buildx-
- name: Login to DockerHub
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- id: tf-versions
run: |
DEFAULT_TERRAFORM_VERSION=$(cat .terraform.versions.json | jq -r '.default')
AVAILABLE_TERRAFORM_VERSIONS=$(cat .terraform.versions.json | jq -r '.available | join(" ")')
echo "default=$DEFAULT_TERRAFORM_VERSION" >> $GITHUB_OUTPUT
echo "available=$AVAILABLE_TERRAFORM_VERSIONS" >> $GITHUB_OUTPUT
- id: cdktf-version
run: |
CDKTF_VERSION=$(cat package.json | jq -r '.version')
echo "cdktf=$CDKTF_VERSION" >> $GITHUB_OUTPUT
- id: git-sha
run: |
GIT_SHA=$(git rev-parse HEAD)
echo "git-sha=$GIT_SHA" >> $GITHUB_OUTPUT
- name: Build and push
uses: docker/build-push-action@5cd11c3a4ced054e52742c5fd54dca954e0edd85 # v6.7.0
with:
pull: true
push: true
tags: hashicorp/jsii-terraform:latest,hashicorp/jsii-terraform:${{ steps.cdktf-version.outputs.cdktf }},hashicorp/jsii-terraform:${{ steps.cdktf-version.outputs.cdktf }}-${{ steps.git-sha.outputs.git-sha }}
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache
build-args: |
DEFAULT_TERRAFORM_VERSION=${{ steps.tf-versions.outputs.default }}
AVAILABLE_TERRAFORM_VERSIONS=${{ steps.tf-versions.outputs.available }}