Skip to content
This repository has been archived by the owner on Nov 28, 2024. It is now read-only.

Fewensa ci #2

Merged
merged 4 commits into from
Mar 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Check pull request

on:
push:
branches: [master]
pull_request:
branches: [main]

jobs:
check-code:
name: Check code
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- uses: actions/setup-node@v2
with:
node-version: '16'

- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"

- uses: actions/cache@v2
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-

- name: Install dependencies
run: yarn install

- name: Lint script
run: yarn lint

- name: Test build
run: yarn build

32 changes: 32 additions & 0 deletions .github/workflows/deploy-dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Deploy develop

on:
pull_request:

jobs:
deploy:
name: Deploy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- uses: actions/checkout@v2
with:
repository: darwinia-network/devops
path: .github

- uses: ./.github/actions/smart-vercel
name: Deploy to Vercel
id: smart-vercel
with:
vercel_token: ${{ secrets.VERCEL_TOKEN }}
vercel_group: itering
preview_output: true
dist_path: out
project_name: kton-stake
enable_cache: true
enable_notify_comment: true
enable_notify_slack: true
slack_channel: darwinia-apps
slack_webhook: ${{ secrets.SLACK_INCOMING_WEBHOOK_URL }}

33 changes: 33 additions & 0 deletions .github/workflows/deploy-prd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Deploy production

on:
push:
tags:
- 'v*'

jobs:
deploy:
name: Deploy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- uses: actions/checkout@v2
with:
repository: darwinia-network/devops
path: .github

- uses: ./.github/actions/smart-vercel
name: Deploy to Vercel
id: smart-vercel
with:
vercel_token: ${{ secrets.VERCEL_TOKEN }}
vercel_group: itering
preview_output: true
dist_path: out
project_name: kton-stake
prod_mode: true
enable_cache: true
enable_notify_slack: true
slack_channel: darwinia-apps
slack_webhook: ${{ secrets.SLACK_INCOMING_WEBHOOK_URL }}
32 changes: 32 additions & 0 deletions .github/workflows/deploy-stg.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Deploy staging

on:
push:
branches: [main]

jobs:
deploy:
name: Deploy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- uses: actions/checkout@v2
with:
repository: darwinia-network/devops
path: .github

- uses: ./.github/actions/smart-vercel
name: Deploy to Vercel
id: smart-vercel
with:
vercel_token: ${{ secrets.VERCEL_TOKEN }}
vercel_group: itering
preview_output: true
dist_path: out
project_name: kton-stake
alias_domain: "kton-stake-stg"
enable_cache: true
enable_notify_slack: true
slack_channel: darwinia-apps
slack_webhook: ${{ secrets.SLACK_INCOMING_WEBHOOK_URL }}
12 changes: 0 additions & 12 deletions .vscode/settings.json

This file was deleted.

1 change: 1 addition & 0 deletions next.config.mjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/** @type {import('next').NextConfig} */
const nextConfig = {
output: 'export',
webpack: (config, { isServer }) => {
if (isServer) {
config.externals = config.externals.filter(
Expand Down
25 changes: 25 additions & 0 deletions vercel.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"headers": [
{
"source": "/(.*)",
"headers": [
{
"key": "X-Content-Type-Options",
"value": "nosniff"
},
{
"key": "Referrer-Policy",
"value": "origin-when-cross-origin"
},
{
"key": "X-Frame-Options",
"value": "SAMEORIGIN"
},
{
"key": "Strict-Transport-Security",
"value": "max-age=2592000"
}
]
}
]
}
Loading