-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #31 from gnosischain/dev
Feat/UI update - new ui for Gnosis Deposit (main)
- Loading branch information
Showing
150 changed files
with
170,006 additions
and
22,582 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 |
---|---|---|
@@ -1 +1 @@ | ||
REACT_APP_NETWORK_IDS=100,10200 | ||
NEXT_PUBLIC_WC_PROJECT_ID= |
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,3 @@ | ||
{ | ||
"extends": "next/core-web-vitals" | ||
} |
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,69 @@ | ||
name: Automatic Deployment to Dev/Staging | ||
|
||
on: | ||
# Launches for pushes to main or dev | ||
push: | ||
branches: | ||
- main | ||
- dev | ||
|
||
env: | ||
NEXT_PUBLIC_WC_PROJECT_ID: ${{ secrets.DEV_WC_PROJECT_ID }} | ||
|
||
jobs: | ||
deploy: | ||
name: Deployment | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Cancel Previous Runs | ||
uses: styfle/cancel-workflow-action@0.8.0 | ||
with: | ||
access_token: ${{ github.token }} | ||
|
||
- uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- uses: actions/cache@v2 | ||
with: | ||
path: '**/node_modules' | ||
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }} | ||
|
||
- name: Setup Node.js | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: 20.12.1 | ||
|
||
- name: Install | ||
run: | | ||
rm -rf .cache | ||
rm -rf build | ||
yarn config set cache-folder .yarn | ||
yarn install | ||
pip install awscli --upgrade --user | ||
- name: Build App | ||
run: yarn build | ||
|
||
- name: Configure AWS Development credentials | ||
uses: aws-actions/configure-aws-credentials@v1 | ||
if: ( github.ref == 'refs/heads/dev' || github.ref == 'refs/heads/main' ) | ||
with: | ||
aws-access-key-id: ${{ secrets.DEV_AWS_ACCESS_KEY_ID }} | ||
aws-secret-access-key: ${{ secrets.DEV_AWS_SECRET_ACCESS_KEY }} | ||
aws-region: ${{ secrets.DEV_AWS_DEFAULT_REGION }} | ||
|
||
# Script to deploy to development environment | ||
- name: 'Deploy to S3: Development' | ||
if: github.ref == 'refs/heads/dev' | ||
run: | | ||
aws s3 sync build/ s3://${{ secrets.DEV_BUCKET_NAME }}/dev --exclude "*.html" --cache-control max-age=0,no-cache,no-store,public | ||
aws s3 sync build/ s3://${{ secrets.DEV_BUCKET_NAME }}/dev --exclude "*" --include "*.html" --cache-control max-age=0,no-cache,no-store,must-revalidate --content-type text/html | ||
# Script to deploy to staging environment | ||
- name: 'Deploy to S3: Staging' | ||
if: github.ref == 'refs/heads/main' | ||
run: | | ||
aws s3 sync build/ s3://${{ secrets.DEV_BUCKET_NAME }}/main --exclude "*.html" --cache-control max-age=0,no-cache,no-store,public | ||
aws s3 sync build/ s3://${{ secrets.DEV_BUCKET_NAME }}/main --exclude "*" --include "*.html" --cache-control max-age=0,no-cache,no-store,must-revalidate --content-type text/html |
This file was deleted.
Oops, something went wrong.
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,84 @@ | ||
name: Manual Deployment to Production | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
tag: | ||
description: Tagged version to deploy | ||
required: true | ||
type: string | ||
|
||
env: | ||
NEXT_PUBLIC_WC_PROJECT_ID: ${{ secrets.PROD_WC_PROJECT_ID }} | ||
|
||
jobs: | ||
deploy: | ||
name: Deployment | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Cancel Previous Runs | ||
uses: styfle/cancel-workflow-action@0.8.0 | ||
with: | ||
access_token: ${{ github.token }} | ||
|
||
- name: Remove broken apt repos [Ubuntu] | ||
if: ${{ matrix.os }} == 'ubuntu-latest' | ||
run: | | ||
for apt_file in `grep -lr microsoft /etc/apt/sources.list.d/`; do sudo rm $apt_file; done | ||
- uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Tag checkout | ||
run: | ||
git checkout ${{ github.event.inputs.tag }} | ||
|
||
- uses: actions/cache@v2 | ||
with: | ||
path: '**/node_modules' | ||
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }} | ||
|
||
- name: Setup Node.js | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: 18.14.0 | ||
|
||
- name: Install | ||
run: | | ||
rm -rf .cache | ||
rm -rf build | ||
yarn config set cache-folder .yarn | ||
yarn install | ||
pip install awscli --upgrade --user | ||
- name: Build App for release | ||
run: yarn build | ||
|
||
- name: Configure AWS Production credentials | ||
uses: aws-actions/configure-aws-credentials@v1 | ||
with: | ||
aws-access-key-id: ${{ secrets.PROD_AWS_ACCESS_KEY_ID }} | ||
aws-secret-access-key: ${{ secrets.PROD_AWS_SECRET_ACCESS_KEY }} | ||
aws-region: ${{ secrets.PROD_AWS_DEFAULT_REGION }} | ||
|
||
# Script to deploy to release environment | ||
- name: 'Deploy to S3: Release' | ||
run: | | ||
aws s3 sync build/ s3://${{ secrets.RELEASE_BUCKET_NAME }} --delete --exclude "*.html" --exclude "sitemap.xml" --cache-control max-age=86400,public | ||
aws s3 sync build/ s3://${{ secrets.RELEASE_BUCKET_NAME }} --delete --exclude "*" --include "*.html" --cache-control max-age=0,no-cache,no-store,must-revalidate --content-type text/html | ||
aws s3 sync build/ s3://${{ secrets.RELEASE_BUCKET_NAME }} --delete --exclude "*" --include "sitemap.xml" --cache-control max-age=0,no-cache,no-store,must-revalidate --content-type text/xml | ||
notify: | ||
uses: ./.github/workflows/slack_release_notification.yml | ||
if: ${{ always() }} | ||
needs: [ deploy ] | ||
secrets: | ||
RELEASES_SLACK_WEBHOOK_URL: ${{ secrets.RELEASES_SLACK_WEBHOOK_URL }} | ||
with: | ||
environment: Production | ||
service: GC Deposit UI | ||
success: ${{ contains(join(needs.*.result, ','), 'success') }} | ||
message: "deploy service `GC Deposit UI` version `${{ inputs.tag }}`. Triggered by `${{ github.actor }}`." | ||
|
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,46 @@ | ||
name: Slack Notify Release | ||
on: | ||
workflow_call: | ||
secrets: | ||
RELEASES_SLACK_WEBHOOK_URL: | ||
required: true | ||
inputs: | ||
environment: | ||
type: string | ||
required: true | ||
message: | ||
type: string | ||
required: true | ||
service: | ||
type: string | ||
required: true | ||
success: | ||
type: boolean | ||
required: true | ||
|
||
jobs: | ||
notify: | ||
name: Notify ${{ inputs.service }} release in ${{ inputs.environment }} | ||
runs-on: ubuntu-latest | ||
environment: ${{ inputs.environment }} | ||
steps: | ||
- name: Extract branch name | ||
shell: bash | ||
run: echo "branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_OUTPUT | ||
id: extract_branch | ||
|
||
- name: Extract commit | ||
id: commit | ||
uses: prompt/actions-commit-hash@v2 | ||
|
||
- name: Get current date | ||
id: date | ||
run: echo "::set-output name=date::$(date +'%Y-%m-%dT%H:%M:%S')" | ||
|
||
- id: slack | ||
uses: slackapi/slack-github-action@v1.24.0 | ||
with: | ||
payload: "{\"username\":\"Releases\",\"icon_url\":\"https://avatars3.githubusercontent.com/u/134083290\",\"text\":\"${{ inputs.message }} - ${{ github.event.head_commit.message }}\",\"attachments\":[{\"text\":\"\",\"color\":\"${{ inputs.success == true && '#36a64f' || '#FF3131' }}\",\"author_name\":\"${{ inputs.service }}\",\"title\":\"\",\"fields\":[{\"title\":\"Environment\",\"short\":true,\"value\":\"`${{ inputs.environment }}`\"},{\"title\":\"Branch\",\"short\":true,\"value\":\"${{ steps.extract_branch.outputs.branch }}\"},{\"title\":\"Commit\",\"short\":true,\"value\":\"${{ steps.commit.outputs.short }}\"},{\"title\":\"Status\",\"short\":true,\"value\":\"${{ inputs.success == true && '🟢 SUCCEEDED' || '🔴 FAILED' }}\"},{\"title\":\"Time\",\"short\":true,\"value\":\"${{ steps.date.outputs.date }}\"}]}]}" | ||
env: | ||
SLACK_WEBHOOK_URL: ${{ secrets.RELEASES_SLACK_WEBHOOK_URL }} | ||
SLACK_WEBHOOK_TYPE: "INCOMING_WEBHOOK" |
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,52 @@ | ||
name: Create Github Release | ||
|
||
on: | ||
push: | ||
tags: | ||
- 'v[0-9]+.[0-9]+.[0-9]+' | ||
|
||
# Permission can be added at job level or workflow level | ||
permissions: | ||
contents: write # This is required for actions/checkout and create release | ||
|
||
jobs: | ||
release: | ||
name: Github Release | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Cancel Previous Runs | ||
uses: styfle/cancel-workflow-action@0.8.0 | ||
with: | ||
access_token: ${{ github.token }} | ||
|
||
- uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Create Github Release | ||
uses: actions/github-script@v6 | ||
with: | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
script: | | ||
if (!${{ toJson(github.ref_name) }}) { | ||
core.setFailed("RELEASE_TAG is not defined.") | ||
return; | ||
} | ||
try { | ||
const response = await github.rest.repos.createRelease({ | ||
name: ${{ toJson(github.ref_name) }}, | ||
tag_name: ${{ toJson(github.ref_name) }}, | ||
draft: false, | ||
generate_release_notes: true, | ||
owner: context.repo.owner, | ||
prerelease: false, | ||
repo: context.repo.repo, | ||
}); | ||
core.exportVariable('RELEASE_ID', response.data.id); | ||
core.exportVariable('RELEASE_UPLOAD_URL', response.data.upload_url); | ||
} catch (error) { | ||
core.setFailed(error.message); | ||
} |
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 |
---|---|---|
@@ -1,32 +1,38 @@ | ||
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. | ||
# environment | ||
.env | ||
.env.development.local | ||
.env.test.local | ||
.env.production.local | ||
.env.local | ||
|
||
# dependencies | ||
/node_modules | ||
/.pnp | ||
.pnp.js | ||
.yarn/install-state.gz | ||
|
||
# testing | ||
/coverage | ||
|
||
# next.js | ||
/.next/ | ||
/out/ | ||
|
||
# production | ||
/build | ||
|
||
# ides | ||
.vscode | ||
|
||
# misc | ||
.DS_Store | ||
.env.local | ||
.env.development.local | ||
.env.test.local | ||
.env.production.local | ||
*.pem | ||
|
||
# debug | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
|
||
# local env files | ||
.env*.local | ||
|
||
# vercel | ||
.vercel | ||
|
||
# typescript | ||
*.tsbuildinfo | ||
next-env.d.ts | ||
|
||
.env |
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 |
---|---|---|
@@ -1 +1 @@ | ||
v16.14.2 | ||
20.12.1 |
Oops, something went wrong.