Skip to content

Update Helm chart install doc (#211) #45

Update Helm chart install doc (#211)

Update Helm chart install doc (#211) #45

Workflow file for this run

name: build
on:
push:
branches:
- main
- release/**
workflow_dispatch:
env:
PKG_NAME: 'terraform-cloud-operator'
DOCKER_HUB_REPO: 'hashicorp/terraform-cloud-operator'
DOCKER_HUB_DEV_REPO: 'hashicorppreview/terraform-cloud-operator'
jobs:
set-product-version:
runs-on: ubuntu-latest
outputs:
product-version: ${{ steps.set-product-version.outputs.product-version }}
steps:
- name: Checkout repository
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
- name: Set product version
id: set-product-version
uses: hashicorp/actions-set-product-version@06bddb8ee70f0dda2e21c39b5f0913d36cc9d657 # v1
generate-metadata-file:
needs: set-product-version
runs-on: ubuntu-latest
env:
METADATA_FILE_NAME: 'metadata.json'
outputs:
filepath: ${{ steps.generate-metadata-file.outputs.filepath }}
steps:
- name: Checkout repository
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
- name: Generate metadata file
id: generate-metadata-file
uses: hashicorp/actions-generate-metadata@fdbc8803a0e53bcbb912ddeee3808329033d6357 # v1.1.1
with:
version: ${{ needs.set-product-version.outputs.product-version }}
product: ${{ env.PKG_NAME }}
repositoryOwner: 'hashicorp'
metadataFileName: ${{ env.METADATA_FILE_NAME }}
- uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
with:
name: metadata.json
path: ${{ env.METADATA_FILE_NAME }}
build:
name: Go Linux ${{ matrix.arch }} build
needs: [set-product-version]
runs-on: ubuntu-latest
outputs:
go-version: ${{ steps.set-up-go.outputs.go-version }}
strategy:
matrix:
arch: ["amd64", "arm64"]
steps:
- name: Checkout repository
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
- name: Setup Go
id: set-up-go
uses: actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753 # v4.0.1
with:
go-version-file: 'go.mod'
- name: Go build
uses: hashicorp/actions-go-build@e20c6be7bf010e40e930dab20e6da63176725ec1 # v0.1.9
env:
CGO_ENABLED: 0
with:
product_name: ${{ env.PKG_NAME }}
product_version: ${{ needs.set-product-version.outputs.product-version }}
bin_name: ${{ vars.BIN_NAME }}
go_version: ${{ steps.set-up-go.outputs.go-version }}
os: linux
arch: ${{ matrix.arch }}
reproducible: report
instructions: |
go build -trimpath -o $BIN_PATH main.go
build-docker:
name: Docker ${{ matrix.arch }} build
needs: [build, set-product-version]
runs-on: ubuntu-latest
strategy:
matrix:
arch: ["amd64", "arm64"]
steps:
- name: Checkout repository
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
- name: Docker build
uses: hashicorp/actions-docker-build@2771d60f540373a86cf21177de69624b4de7de69 # v1.5.0
env:
VERSION: ${{ needs.set-product-version.outputs.product-version }}
GO_VERSION: ${{ needs.build.outputs.go-version }}
with:
version: ${{ env.VERSION }}
bin_name: ${{ vars.BIN_NAME }}
target: release-default
arch: ${{ matrix.arch }}
tags: |
docker.io/${{ env.DOCKER_HUB_REPO }}:${{ env.VERSION }}
dev_tags: |
docker.io/${{ env.DOCKER_HUB_DEV_REPO }}:${{ env.VERSION }}
docker.io/${{ env.DOCKER_HUB_DEV_REPO }}:${{ env.VERSION }}-${{ github.sha }}