forked from Uniswap/interface
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: GH action for deploying to production (Uniswap#6482)
* GH action for deploying to production * Remove dependency on tests * Update .github/workflows/4-deploy-to-prod.yml Co-authored-by: Zach Pomerantz <[email protected]> * Update .github/workflows/4-deploy-to-prod.yml Co-authored-by: Zach Pomerantz <[email protected]> * Add tag as action step rather than separate target * Comments * Update .github/workflows/4-deploy-to-prod.yml Co-authored-by: Zach Pomerantz <[email protected]> * Specify branches * Update run name --------- Co-authored-by: Zach Pomerantz <[email protected]>
- Loading branch information
Showing
1 changed file
with
91 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,91 @@ | ||
name: 4 | Deploy to prod | ||
on: | ||
push: | ||
branches: | ||
- 'releases/prod' | ||
|
||
jobs: | ||
deploy-to-prod: | ||
environment: | ||
name: prod | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: ./.github/actions/setup | ||
- run: yarn prepare | ||
- run: yarn build | ||
- name: Bump and tag | ||
id: github-tag-action | ||
uses: mathieudutour/[email protected] | ||
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/[email protected] | ||
with: | ||
cidv0: ${{ steps.pinata.outputs.hash }} | ||
|
||
- name: Release | ||
uses: actions/[email protected] | ||
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: Setup node@16 (required by Cloudflare Pages) | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 16 | ||
|
||
- name: Update Cloudflare Pages deployment | ||
uses: cloudflare/pages-action@364c7ca09a4b57837c5967871d64a2c31adb8c0d | ||
with: | ||
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} | ||
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} | ||
projectName: ${{ secrets.CLOUDFLARE_PROJECT_NAME }} | ||
directory: build | ||
githubToken: ${{ secrets.GITHUB_TOKEN }} | ||
branch: main | ||
|
||
- 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' | ||
|