Skip to content

Commit

Permalink
Merge pull request #9 from mtphil/add-release-hook
Browse files Browse the repository at this point in the history
Add release hook
  • Loading branch information
mtphil committed May 14, 2022
2 parents 923bfca + c6526a2 commit da2c23a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/terraform-apply.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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}'
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}'

0 comments on commit da2c23a

Please sign in to comment.