Cloud expo demo #18
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: 'Infra' | |
on: | |
pull_request: | |
push: | |
branches: | |
- main | |
env: | |
PLATFORM_REPO: "cldcvr/terrarium" | |
PLATFORM_BRANCH: "main" | |
PLATFORM_DIR: "examples/platform-demo/platform" | |
TERRARIUM_VERSION: "v0.6" | |
TF_API_TOKEN: "${{ secrets.TF_API_TOKEN }}" | |
TF_CLOUD_ORGANIZATION: "kanak" | |
TF_WORKSPACE: "demo-go-pgsql-workflow" | |
TF_CONFIG_DIRECTORY: "./.terrarium-output" | |
jobs: | |
t8-generate: | |
name: "Terrarium generate" | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
pull-requests: write | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Checkout Platform Repo | |
uses: actions/checkout@v3 | |
with: | |
repository: ${{ env.PLATFORM_REPO }} | |
ref: ${{ env.PLATFORM_BRANCH }} | |
token: ${{ secrets.GH_TOKEN }} | |
path: "./.platform-repo" | |
- name: Terrarium Install | |
uses: supplypike/setup-bin@v3 | |
with: | |
uri: 'https://github.com/cldcvr/terrarium/releases/download/${{ env.TERRARIUM_VERSION }}/terrarium-${{ env.TERRARIUM_VERSION }}-linux-amd64.tar.gz' | |
name: 'terrarium' | |
version: ${{ env.TERRARIUM_VERSION }} | |
- name: Terrarium Generate | |
run: | | |
terrarium generate -p .platform-repo/$PLATFORM_DIR -a . -o $TF_CONFIG_DIRECTORY/src | |
cp -r .platform-repo/examples/platform-demo/modules ./$TF_CONFIG_DIRECTORY/modules | |
- name: "Push Terrarium generated code at path : ${{ env.TF_CONFIG_DIRECTORY }}" | |
uses: stefanzweifel/git-auto-commit-action@v4 | |
with: | |
commit_message: terrarium-generate-code | |
branch: ${{ github.head_ref || github.ref_name }} | |