From fef8e4a37c2f6334c9b824d68a704fc35881703c Mon Sep 17 00:00:00 2001 From: fewensa <37804932+fewensa@users.noreply.github.com> Date: Sun, 8 Oct 2023 19:04:23 +0800 Subject: [PATCH 1/5] Try CI --- .github/workflows/deploy-dev.yml | 32 ++++++++++++++++++++++++++++++++ vercel.json | 26 ++++++++++++++++++++++++++ 2 files changed, 58 insertions(+) create mode 100644 .github/workflows/deploy-dev.yml create mode 100644 vercel.json diff --git a/.github/workflows/deploy-dev.yml b/.github/workflows/deploy-dev.yml new file mode 100644 index 0000000..522317e --- /dev/null +++ b/.github/workflows/deploy-dev.yml @@ -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: itering/actions + path: .github/actions + persist-credentials: false + ssh-key: "${{ secrets.ITERING_ACTIONS_DEPLOY_KEY }}" + + - uses: ./.github/actions/smart-vercel + name: Deploy to Vercel + id: smart-vercel + with: + vercel_token: ${{ secrets.VERCEL_TOKEN }} + vercel_group: itering + preview_output: true + project_name: helix-docs + enable_cache: true + enable_notify_comment: true + enable_notify_slack: true + slack_channel: helix-ui + slack_webhook: ${{ secrets.SLACK_INCOMING_WEBHOOK_URL }} diff --git a/vercel.json b/vercel.json new file mode 100644 index 0000000..8f538a7 --- /dev/null +++ b/vercel.json @@ -0,0 +1,26 @@ +{ + "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" + } + ] + } + ], + "rewrites": [{ "source": "/*", "destination": "/index.html" }] + } From 1119562f354efb76c795edd28713c28157e9fb2d Mon Sep 17 00:00:00 2001 From: fewensa <37804932+fewensa@users.noreply.github.com> Date: Sun, 8 Oct 2023 19:07:15 +0800 Subject: [PATCH 2/5] CI --- .github/workflows/deploy-dev.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/deploy-dev.yml b/.github/workflows/deploy-dev.yml index 522317e..1cae8db 100644 --- a/.github/workflows/deploy-dev.yml +++ b/.github/workflows/deploy-dev.yml @@ -22,6 +22,7 @@ jobs: id: smart-vercel with: vercel_token: ${{ secrets.VERCEL_TOKEN }} + node_version: 18 vercel_group: itering preview_output: true project_name: helix-docs From ee8231113298a23544776c8dd90d1697648d139c Mon Sep 17 00:00:00 2001 From: fewensa <37804932+fewensa@users.noreply.github.com> Date: Sun, 8 Oct 2023 19:11:07 +0800 Subject: [PATCH 3/5] CI --- .github/workflows/deploy-dev.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/deploy-dev.yml b/.github/workflows/deploy-dev.yml index 1cae8db..96bea22 100644 --- a/.github/workflows/deploy-dev.yml +++ b/.github/workflows/deploy-dev.yml @@ -23,6 +23,7 @@ jobs: with: vercel_token: ${{ secrets.VERCEL_TOKEN }} node_version: 18 + dist_path: dist vercel_group: itering preview_output: true project_name: helix-docs From 056df8a3c299aac7ab70da8c604a5c68badd6f91 Mon Sep 17 00:00:00 2001 From: fewensa <37804932+fewensa@users.noreply.github.com> Date: Sun, 8 Oct 2023 19:14:44 +0800 Subject: [PATCH 4/5] CI --- vercel.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vercel.json b/vercel.json index 8f538a7..eeb87c1 100644 --- a/vercel.json +++ b/vercel.json @@ -22,5 +22,5 @@ ] } ], - "rewrites": [{ "source": "/*", "destination": "/index.html" }] + "rewrites": [{ "source": "/:path*", "destination": "/index.html" }] } From 66a1f74629e37b573254f80ae490f70cf692fa81 Mon Sep 17 00:00:00 2001 From: fewensa <37804932+fewensa@users.noreply.github.com> Date: Sun, 8 Oct 2023 19:22:30 +0800 Subject: [PATCH 5/5] Add stg and prd --- .github/workflows/deploy-prd.yml | 36 ++++++++++++++++++++++++++++++++ .github/workflows/deploy-stg.yml | 35 +++++++++++++++++++++++++++++++ 2 files changed, 71 insertions(+) create mode 100644 .github/workflows/deploy-prd.yml create mode 100644 .github/workflows/deploy-stg.yml diff --git a/.github/workflows/deploy-prd.yml b/.github/workflows/deploy-prd.yml new file mode 100644 index 0000000..13d9a43 --- /dev/null +++ b/.github/workflows/deploy-prd.yml @@ -0,0 +1,36 @@ +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: itering/actions + path: .github/actions + persist-credentials: false + ssh-key: "${{ secrets.ITERING_ACTIONS_DEPLOY_KEY }}" + + - uses: ./.github/actions/smart-vercel + name: Deploy to Vercel + id: smart-vercel + with: + vercel_token: ${{ secrets.VERCEL_TOKEN }} + node_version: 18 + dist_path: dist + vercel_group: itering + preview_output: true + project_name: helix-docs + prod_mode: true + enable_cache: true + enable_notify_slack: true + slack_channel: helix-ui + slack_webhook: ${{ secrets.SLACK_INCOMING_WEBHOOK_URL }} diff --git a/.github/workflows/deploy-stg.yml b/.github/workflows/deploy-stg.yml new file mode 100644 index 0000000..d1f2728 --- /dev/null +++ b/.github/workflows/deploy-stg.yml @@ -0,0 +1,35 @@ +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: itering/actions + path: .github/actions + persist-credentials: false + ssh-key: "${{ secrets.ITERING_ACTIONS_DEPLOY_KEY }}" + + - uses: ./.github/actions/smart-vercel + name: Deploy to Vercel + id: smart-vercel + with: + vercel_token: ${{ secrets.VERCEL_TOKEN }} + node_version: 18 + dist_path: dist + vercel_group: itering + preview_output: true + project_name: helix-docs + enable_cache: true + enable_notify_slack: true + slack_channel: helix-ui + slack_webhook: ${{ secrets.SLACK_INCOMING_WEBHOOK_URL }} +