feat(ci): update DNS for mainnet console when new version is released (#3783)
This commit is contained in:
parent
11173d6614
commit
c0320c2468
51
.github/workflows/publish-dist.yml
vendored
51
.github/workflows/publish-dist.yml
vendored
@ -191,37 +191,36 @@ jobs:
|
|||||||
-d '{"query": "mutation{triggerDeploy(siteId:\"f8f2e051-f18e-49e6-b876-0a39369dc0d8\"){id status}}"}' \
|
-d '{"query": "mutation{triggerDeploy(siteId:\"f8f2e051-f18e-49e6-b876-0a39369dc0d8\"){id status}}"}' \
|
||||||
https://api.fleek.co/graphql
|
https://api.fleek.co/graphql
|
||||||
|
|
||||||
- name: Checkout vega.xyz
|
- name: Update vega.trading DNS to redirect to the new console
|
||||||
if: ${{ matrix.app == 'trading' && github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') }}
|
if: ${{ matrix.app == 'trading' && github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') }}
|
||||||
uses: actions/checkout@v3
|
|
||||||
with:
|
|
||||||
repository: vegaprotocol/vega.xyz
|
|
||||||
path: './vega-xyz'
|
|
||||||
token: ${{ secrets.VEGA_CI_BOT_GITHUB_TOKEN }}
|
|
||||||
|
|
||||||
- name: Update hash on interstitial page
|
|
||||||
if: ${{ matrix.app == 'trading' && github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') }}
|
|
||||||
env:
|
|
||||||
GH_TOKEN: ${{ secrets.VEGA_CI_BOT_GITHUB_TOKEN }}
|
|
||||||
run: |
|
run: |
|
||||||
curl -L https://dist.ipfs.tech/kubo/v0.20.0/kubo_v0.20.0_linux-amd64.tar.gz -o kubo.tgz
|
curl -L https://dist.ipfs.tech/kubo/v0.20.0/kubo_v0.20.0_linux-amd64.tar.gz -o kubo.tgz
|
||||||
tar -xzf kubo.tgz
|
tar -xzf kubo.tgz
|
||||||
export PATH="$PATH:$PWD/kubo"
|
export PATH="$PATH:$PWD/kubo"
|
||||||
which ipfs
|
which ipfs
|
||||||
new_hash=$(cat ${{ matrix.app }}-ipfs-hash)
|
new_hash=$(cat ${{ matrix.app }}-ipfs-hash)
|
||||||
cd vega-xyz
|
new_cid=$(ipfs cid format -v 1 -b base32 $new_hash)
|
||||||
./interstital-allow-update.sh ${new_hash}
|
|
||||||
git config --global user.email "vega-ci-bot@vega.xyz"
|
|
||||||
git config --global user.name "vega-ci-bot"
|
|
||||||
git add interstitial-allow.json netlify.toml
|
|
||||||
commit_msg="feat(ci): Update CID for console release @ ${{ github.ref }}"
|
|
||||||
git commit -m "${commit_msg}"
|
|
||||||
git push origin main
|
|
||||||
|
|
||||||
# branch_name=${{ github.ref_name }}-hash-update
|
# Generate console URL
|
||||||
# git checkout -b "${branch_name}"
|
new_console_url_type=ipfs
|
||||||
# git add interstitial-allow.json netlify.toml
|
# new_console_url_type=ipns
|
||||||
# git push -u origin "${branch_name}"
|
new_console_url_domain=cf-ipfs.com
|
||||||
# pr_url="$(gh pr create --title "${commit_msg}" --body 'update ipfs hash for console @ ${{ github.ref }}')"
|
# new_console_url_domain=dweb.link
|
||||||
# echo $pr_url
|
new_console_url="https://${new_cid}.${new_console_url_type}.${new_console_url_domain}/"
|
||||||
# gh pr merge --admin --auto $pr_url
|
echo "new_console_url=${new_console_url}"
|
||||||
|
|
||||||
|
# Update record in DNSimple
|
||||||
|
# docs: https://developer.dnsimple.com/v2/zones/records/#updateZoneRecord
|
||||||
|
dnsimple_account_id=84895
|
||||||
|
dnsimple_zone_name=vega.trading
|
||||||
|
dnsimple_record_id=44409591
|
||||||
|
# see: https://dnsimple.com/a/84895/domains/vega.trading/records/44409591/edit
|
||||||
|
|
||||||
|
curl -H 'Authorization: Bearer ${{ secrets.DNSIMPLE_API_TOKEN }}' \
|
||||||
|
-H 'Accept: application/json' \
|
||||||
|
-H 'Content-Type: application/json' \
|
||||||
|
-X PATCH \
|
||||||
|
-d "{
|
||||||
|
\"content\": \"${new_console_url}\"
|
||||||
|
}" \
|
||||||
|
https://api.dnsimple.com/v2/${dnsimple_account_id}/zones/${dnsimple_zone_name}/records/${dnsimple_record_id}
|
||||||
|
Loading…
Reference in New Issue
Block a user