Skip to content

Commit

Permalink
Merge pull request #6 from ipfs/fix-build
Browse files Browse the repository at this point in the history
ci: fix DNSLink CID
  • Loading branch information
2color authored Feb 3, 2025
2 parents e6de83e + 9b93896 commit 366020d
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ concurrency:
jobs:
build-and-deploy:
runs-on: ubuntu-latest
outputs:
cid: ${{ steps.deploy.outputs.cid }}
steps:
- name: Checkout code
uses: actions/checkout@v4
Expand Down Expand Up @@ -60,15 +62,24 @@ jobs:
steps:
- name: Update DNSLink
run: |
if [ -z "${{ env.DNSLINK_NAME }}" ]; then
echo "Error: DNSLINK_NAME is empty. Skipping DNSLink update."
exit 1
fi
if [ -z "${{ env.DNSLINK_CID }}" ]; then
echo "Error: DNSLINK_CID is empty. Skipping DNSLink update."
exit 1
fi
echo "Updating DNSLink for: ${{ env.DNSLINK_NAME }}"
curl --request PUT \
--header "Authorization: Bearer ${AUTH_TOKEN}" \
--header 'Content-Type: application/json' \
--url "https://api.cloudflare.com/client/v4/zones/${ZONE_ID}/dns_records/${RECORD_ID}" \
--data "{
\"type\": \"TXT\",
\"name\": \"_dnslink.${DNSLINK_NAME}\",
\"content\": \"dnslink=/ipfs/${DNSLINK_CID}\",
\"name\": \"_dnslink.${{ env.DNSLINK_NAME }}\",
\"content\": \"dnslink=/ipfs/${{ env.DNSLINK_CID }}\",
\"comment\": \"${{ github.repository }}/${{ github.sha }}\"
}"
env:
Expand Down

0 comments on commit 366020d

Please sign in to comment.