2023-05-12 15:30:30 +03:00
name : 4 | Deploy prod
2023-05-10 19:59:59 +03:00
on :
push :
branches :
- 'releases/prod'
jobs :
deploy-to-prod :
2023-05-12 15:30:30 +03:00
runs-on : ubuntu-latest
2023-05-10 19:59:59 +03:00
environment :
2023-05-12 15:30:30 +03:00
name : deploy/prod
2023-05-10 19:59:59 +03:00
steps :
2023-06-22 21:48:42 +03:00
- uses : slackapi/slack-github-action@007b2c3c751a190b6f0f040e47ed024deaa72844
2023-05-19 01:30:43 +03:00
continue-on-error : true
2023-05-17 23:29:06 +03:00
with :
payload : |
{
2023-06-22 21:52:26 +03:00
"text": "Deploy _started_ for ${{ github.ref_name }}"
2023-05-17 23:29:06 +03:00
}
env :
SLACK_WEBHOOK_URL : ${{ secrets.SLACK_WEBHOOK_URL }}
SLACK_WEBHOOK_TYPE : INCOMING_WEBHOOK
2023-06-22 21:48:42 +03:00
2023-05-10 19:59:59 +03:00
- uses : actions/checkout@v3
- uses : ./.github/actions/setup
- run : yarn build
2023-06-22 21:48:42 +03:00
2023-05-10 19:59:59 +03:00
- name : Bump and tag
id : github-tag-action
2023-05-19 01:30:24 +03:00
uses : mathieudutour/github-tag-action@d745f2e74aaf1ee82e747b181f7a0967978abee0
2023-05-10 19:59:59 +03:00
with :
github_token : ${{ secrets.GITHUB_TOKEN }}
release_branches : releases/prod
default_bump : patch
- name : Pin to IPFS
id : pinata
uses : anantaramdas/ipfs-pinata-deploy-action@39bbda1ce1fe24c69c6f57861b8038278d53688d
with :
pin-name : Uniswap ${{ steps.github-tag-action.outputs.new_tag }}
path : './build'
pinata-api-key : ${{ secrets.PINATA_API_KEY }}
pinata-secret-api-key : ${{ secrets.PINATA_API_SECRET_KEY }}
- name : Convert CIDv0 to CIDv1
id : convert-cidv0
uses : uniswap/convert-cidv0-cidv1@v1.0.0
with :
cidv0 : ${{ steps.pinata.outputs.hash }}
2023-06-22 21:48:42 +03:00
- name : Publish release
2023-05-10 19:59:59 +03:00
uses : actions/create-release@v1.1.0
env :
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
with :
tag_name : ${{ steps.github-tag-action.outputs.new_tag }}
release_name : Release ${{ steps.github-tag-action.outputs.new_tag }}
body : |
IPFS hash of the deployment :
- CIDv0 : `${{ steps.pinata.outputs.hash }}`
- CIDv1 : `${{ steps.convert-cidv0.outputs.cidv1 }}`
The latest release is always mirrored at [app.uniswap.org](https://app.uniswap.org).
You can also access the Uniswap Interface from an IPFS gateway.
**BEWARE**: The Uniswap interface uses [`localStorage`](https://developer.mozilla.org/en-US/docs/Web/API/Window/localStorage) to remember your settings, such as which tokens you have imported.
**You should always use an IPFS gateway that enforces origin separation**, or our hosted deployment of the latest release at [app.uniswap.org](https://app.uniswap.org).
Your Uniswap settings are never remembered across different URLs.
IPFS gateways :
- https://${{ steps.convert-cidv0.outputs.cidv1 }}.ipfs.dweb.link/
- https://${{ steps.convert-cidv0.outputs.cidv1 }}.ipfs.cf-ipfs.com/
- [ ipfs://${{ steps.pinata.outputs.hash }}/](ipfs://${{ steps.pinata.outputs.hash }}/)
${{ steps.github-tag-action.outputs.changelog }}
- name : Update Cloudflare Pages deployment
uses : cloudflare/pages-action@364c7ca09a4b57837c5967871d64a2c31adb8c0d
2023-05-17 23:29:06 +03:00
id : pages-deployment
2023-05-10 19:59:59 +03:00
with :
apiToken : ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId : ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
projectName : ${{ secrets.CLOUDFLARE_PROJECT_NAME }}
directory : build
githubToken : ${{ secrets.GITHUB_TOKEN }}
2023-05-17 23:29:06 +03:00
# Cloudflare uses `main` as the default production branch, so we push using the `main` branch so that it can be aliased by a custom domain.
2023-05-10 19:59:59 +03:00
branch : main
2023-06-22 21:48:42 +03:00
- uses : slackapi/slack-github-action@007b2c3c751a190b6f0f040e47ed024deaa72844
2023-05-19 01:30:43 +03:00
continue-on-error : true
2023-05-18 19:43:02 +03:00
if : always()
with :
payload : |
{
2023-06-22 21:52:26 +03:00
"text": "Deploy *${{ steps.pages-deployment.outcome }}* for ${{ github.ref_name }}"
2023-05-18 19:43:02 +03:00
}
env :
SLACK_WEBHOOK_URL : ${{ secrets.SLACK_WEBHOOK_URL }}
SLACK_WEBHOOK_TYPE : INCOMING_WEBHOOK
2023-06-22 21:48:42 +03:00
2023-05-10 19:59:59 +03:00
- name : Upload source maps to Sentry
uses : getsentry/action-release@4744f6a65149f441c5f396d5b0877307c0db52c7
continue-on-error : true
env :
SENTRY_AUTH_TOKEN : ${{ secrets.SENTRY_AUTH_TOKEN }}
SENTRY_ORG : ${{ secrets.SENTRY_ORG }}
SENTRY_PROJECT : ${{ secrets.SENTRY_PROJECT }}
with :
environment : production
sourcemaps : './build/static/js'
url_prefix : '~/static/js'