-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
18 additions
and
18 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,7 +24,7 @@ jobs: | |
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
|
||
- name: Add ecr | ||
- name: Add Domain | ||
shell: bash | ||
run: | | ||
echo ${{ github.event.client_payload.domain }} | ||
|
@@ -33,21 +33,6 @@ jobs: | |
if [ -n "$location" ]; then | ||
sed -i "${location}s|.*|&\n \"$domain_name\",|" cloudflare.tf | ||
fi | ||
- name: Commit with new ECR | ||
uses: stefanzweifel/git-auto-commit-action@v4 | ||
with: | ||
commit_message: "🔀 :: domain [${{ github.event.client_payload.domain }}] 추가" | ||
branch: main | ||
file_pattern: 'cloudflare.tf' | ||
push_options: '--force' | ||
commit_options: '--no-verify --signoff' | ||
repository: . | ||
commit_user_name: XQUARE GitOps Bot | ||
commit_user_email: [email protected] | ||
commit_author: XQUARE GitOps Bot <[email protected]> | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITOPS_DEPLOY_PRODUCTION_TOKEN }} | ||
- name: Set up Terraform | ||
uses: hashicorp/setup-terraform@v1 | ||
|
@@ -67,7 +52,22 @@ jobs: | |
json_result=$(curl -s -X GET "https://api.cloudflare.com/client/v4/zones/${{ env.CLOUDFLARE_ZONE_ID }}/dns_records?type=CNAME&name=${{ github.event.client_payload.domain }}" \ | ||
-H "Authorization: Bearer ${{ env.CLOUDFLARE_API_TOKEN }}") | ||
id=$(echo "$json_result" | jq -r '.result[0].id') | ||
domain_name=$(echo "${{ github.event.client_payload.domain }}" | sed 's/\..*//') | ||
terraform import -lock=false -var 'cloudflare_api_token=${{ env.CLOUDFLARE_API_TOKEN }}' \ | ||
cloudflare_record.xquare_server_record[\"${{ github.event.client_payload.domain }}\"] ${{ env.CLOUDFLARE_ZONE_ID }}/$id | ||
cloudflare_record.xquare_server_record[\"$domain_name\"] ${{ env.CLOUDFLARE_ZONE_ID }}/$id | ||
- name: Commit with new Domain | ||
uses: stefanzweifel/git-auto-commit-action@v4 | ||
with: | ||
commit_message: "🔀 :: domain [${{ github.event.client_payload.domain }}] 추가" | ||
branch: main | ||
file_pattern: 'cloudflare.tf' | ||
push_options: '--force' | ||
commit_options: '--no-verify --signoff' | ||
repository: . | ||
commit_user_name: XQUARE GitOps Bot | ||
commit_user_email: [email protected] | ||
commit_author: XQUARE GitOps Bot <[email protected]> | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITOPS_DEPLOY_PRODUCTION_TOKEN }} |