Skip to content

Merge pull request #2453 from kashalls/renovate/cloudflare-4.x #10

Merge pull request #2453 from kashalls/renovate/cloudflare-4.x

Merge pull request #2453 from kashalls/renovate/cloudflare-4.x #10

Workflow file for this run

---
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json
name: "Publish Terraform"
on:
workflow_dispatch:
push:
branches: ["main"]
paths: ["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@a0de6af83968303c8c955486bf9739a57d23c7f1 # v1
id: app-token
with:
app-id: "${{ secrets.BOT_APP_ID }}"
private-key: "${{ secrets.BOT_APP_PRIVATE_KEY }}"
- name: Checkout
uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b # v4
with:
token: "${{ steps.app-token.outputs.token }}"
- name: Setup Homebrew
uses: Homebrew/actions/setup-homebrew@master
- name: Setup Workflow Tools
shell: bash
run: brew install fluxcd/tap/flux
- name: Login to GitHub Container Registry
uses: docker/login-action@e92390c5fb421da1463c202d546fed0ec5c39f20 # v3
with:
registry: ghcr.io
username: "${{ github.actor }}"
password: "${{ secrets.GITHUB_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 Artifact
shell: bash
run: |
flux push artifact oci://${{ steps.generate-tag.outputs.tag }} \
--path="./terraform" \
--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 main