Skip to content

feat(terraform): update terraform cloudflare to 4.46.0 (#1084) #35

feat(terraform): update terraform cloudflare to 4.46.0 (#1084)

feat(terraform): update terraform cloudflare to 4.46.0 (#1084) #35

---
name: Publish Terraform
on:
workflow_dispatch:
push:
branches: ["main"]
paths: ["terraform/**"]
env:
TERRAFORM_DIR: ./terraform
jobs:
publish-terraform:
name: Publish Terraform
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Generate Token
uses: actions/create-github-app-token@5d869da34e18e7287c1daad50e0b8ea0f506ce69 # v1.11.0
id: app-token
with:
app-id: "${{ secrets.BOT_APP_ID }}"
private-key: "${{ secrets.BOT_APP_PRIVATE_KEY }}"
- name: Setup Path
run: echo "/home/linuxbrew/.linuxbrew/bin" >> $GITHUB_PATH
- name: Setup Workflow Tools
run: brew update && brew install fluxcd/tap/flux
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
token: "${{ steps.app-token.outputs.token }}"
- name: Login to GitHub Container Registry
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0
with:
registry: ghcr.io
username: "${{ github.actor }}"
password: "${{ secrets.GITHUB_TOKEN }}"
# https://github.com/orgs/community/discussions/24636
# username: "${{ secrets.BOT_APP_ID }}"
# password: "${{ steps.app-token.outputs.token }}"
- name: Generate Tag
id: generate-tag
shell: bash
run: echo "tag=ghcr.io/${{ github.repository_owner }}/manifests/terraform:$(git rev-parse --short HEAD)" >> "${GITHUB_OUTPUT}"
- name: Publish OCI Artifacts
shell: bash
run: |
flux push artifact oci://${{ steps.generate-tag.outputs.tag }} \
--path="${{ env.TERRAFORM_DIR }}" \
--source="$(git config --get remote.origin.url)" \
--revision="$(git branch --show-current)/$(git rev-parse HEAD)"
- name: Tag OCI Artifact
shell: bash
run: flux tag artifact oci://${{ steps.generate-tag.outputs.tag }} --tag master