Skip to content

Commit

Permalink
Update add_domain.yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
rlaisqls authored May 12, 2024
1 parent b57ce36 commit d423267
Showing 1 changed file with 18 additions and 18 deletions.
36 changes: 18 additions & 18 deletions .github/workflows/add_domain.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand All @@ -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
Expand All @@ -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 }}

0 comments on commit d423267

Please sign in to comment.