diff --git a/.github/workflows/terraform-apply.yaml b/.github/workflows/terraform-apply.yaml index 65be8fe..7c7f7b3 100644 --- a/.github/workflows/terraform-apply.yaml +++ b/.github/workflows/terraform-apply.yaml @@ -36,5 +36,5 @@ jobs: - name: Terraform Plan run: CONSUL_HTTP_TOKEN=${{ env.CONSUL_API_TOKEN }} TF_VAR_LINODE_KUBERNETES_API_TOKEN=${{ env.LINODE_KUBERNETES_API_TOKEN }} terraform plan -lock=false -input=false -var-file="terraform.tfvars" - name: Terraform Apply - if: github.ref == 'refs/heads/main' && github.event_name == 'release' + if: github.event_name == 'release' && github.event.action == 'released' run: CONSUL_HTTP_TOKEN=${{ env.CONSUL_API_TOKEN }} TF_VAR_LINODE_KUBERNETES_API_TOKEN=${{ env.LINODE_KUBERNETES_API_TOKEN }} terraform apply -lock=false -auto-approve -input=false -var-file="terraform.tfvars" \ No newline at end of file diff --git a/Makefile b/Makefile index 430dda1..9251e8e 100644 --- a/Makefile +++ b/Makefile @@ -21,6 +21,6 @@ generate_github_token: vault token create -policy=github_actions_reader -format json -namespace admin/yoyodynecorp | jq -r ".auth.client_token" list_releases: curl -u mtphil:${GH_TOKEN} -H "Accept: application/vnd.github.v3+json" https://api.github.com/repos/mtphil/linode-k8s-cluster/releases -make_release: - curl -u mtphil:${GH_TOKEN} -X POST -H "Accept: application/vnd.github.v3+json" https://api.github.com/repos/OWNER/REPO/releases \ - -d '{"tag_name":"${tag}","target_commitish":"main","name":${tag},"body":${description},"draft":false,"prerelease":false,"generate_release_notes":false}' \ No newline at end of file +create_release: + curl -u mtphil:${GH_TOKEN} -X POST -H "Accept: application/vnd.github.v3+json" https://api.github.com/repos/mtphil/linode-k8s-cluster/releases \ + -d '{"tag_name":"${tag}","target_commitish":"main","name":"${tag}", "body":"${description}","draft":false,"prerelease":false,"generate_release_notes":false}' \ No newline at end of file