-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: adds deployment pipeline for preview / staging / prod & address…
…es lint issues (#6) # What 💻 * Adds preview / staging / deployment actions for firebase * Runs eslint and corrections * Updates checks.yaml file # Why ✋ * For setting up initial deployment environments * Clean code is good * Adds eslint to checker # Evidence 📷 Include screenshots, screen recordings, or `console` output here demonstrating that your changes work as intended ![Screenshot 2024-03-25 at 9 26 48 AM](https://github.com/matter-labs/zksync-docs/assets/29983536/b7886245-de14-4f8e-b63a-5f6323803ef7) <!-- All sections below are optional. You can uncomment any section applicable to your Pull Request. --> <!-- # Notes 📝 * Any notes/thoughts that the reviewers should know prior to reviewing the code? -->
- Loading branch information
1 parent
118d954
commit df27edd
Showing
19 changed files
with
199 additions
and
39 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,7 @@ | ||
{ | ||
"projects": { | ||
"default": "zksync-docs-staging-5eb09", | ||
"prod": "zksync-docs" | ||
}, | ||
"etags": {} | ||
} |
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,41 +1,51 @@ | ||
name: clean 🧹 | ||
name: check 🕵️ | ||
|
||
on: | ||
pull_request: | ||
branches: [main, staging] | ||
|
||
workflow_dispatch: | ||
|
||
jobs: | ||
format: | ||
name: format | ||
name: code_format | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: oven-sh/setup-bun@v1 | ||
- name: Runs prettier formatter | ||
run: | | ||
bun install | ||
bun run lint:prettier | ||
- name: Install Dependencies | ||
run: bun install | ||
- name: Runs Prettier Formatter | ||
run: bun run lint:prettier | ||
|
||
spelling: | ||
name: spelling | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: oven-sh/setup-bun@v1 | ||
- name: Runs cspell spell checker | ||
run: | | ||
bun install | ||
bun run lint:spelling | ||
- name: Install Dependencies | ||
run: bun install | ||
- name: Runs cSpell Spell Checker | ||
run: bun run lint:spelling | ||
|
||
markdown-lint: | ||
name: markdown_lint | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: oven-sh/setup-bun@v1 | ||
- name: Install Dependencies | ||
run: bun install | ||
- name: Runs Markdown Linter | ||
run: bun run lint:markdown | ||
|
||
lint: | ||
name: lint markdown | ||
eslint: | ||
name: code_lint | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: oven-sh/setup-bun@v1 | ||
- name: Runs mdl markdown linter | ||
run: | | ||
bun install | ||
bun run lint:markdown | ||
- name: Install Dependencies | ||
run: bun install | ||
- name: Runs ESLint | ||
run: bun run lint:eslint |
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,30 @@ | ||
name: "preview builder 👀" | ||
on: | ||
pull_request: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build_and_preview: | ||
env: | ||
NUXT_UI_PRO_LICENSE: ${{ secrets.NUXT_UI_PRO_LICENSE }} | ||
NUXT_PUBLIC_SITE_URL: ${{ secrets.NUXT_PUBLIC_SITE_URL }} | ||
if: ${{ github.event_name == 'workflow_dispatch' || github.event.pull_request.head.repo.full_name == github.repository }} | ||
runs-on: ubuntu-latest | ||
outputs: | ||
output_urls: "${{ steps.preview_deploy.outputs.urls }}" | ||
steps: | ||
- uses: actions/checkout@v4 # v4 | ||
|
||
- uses: oven-sh/setup-bun@v1 | ||
|
||
- name: "Install dependencies" | ||
run: bun install | ||
- name: "Deploy target: staging" | ||
run: bun run build && bun run generate | ||
|
||
- name: "Deploy preview" | ||
uses: matter-labs/action-hosting-deploy@main | ||
with: | ||
repoToken: '${{ secrets.GITHUB_TOKEN }}' | ||
firebaseServiceAccount: "${{ secrets.FIREBASE_SERVICE_ACCOUNT_ZKSYNC_DOCS_STAGING_5EB09 }}" | ||
projectId: zksync-docs-staging-5eb09 |
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,56 @@ | ||
name: "deploy 🚀" | ||
on: | ||
push: | ||
branches: [main] | ||
|
||
jobs: | ||
build_and_deploy: | ||
env: | ||
NUXT_UI_PRO_LICENSE: ${{ secrets.NUXT_UI_PRO_LICENSE }} | ||
if: ${{ github.event.repository.full_name == github.repository }} | ||
runs-on: ubuntu-latest | ||
environment: prod | ||
steps: | ||
- uses: actions/checkout@v4 # v4 | ||
with: | ||
fetch-depth: 0 | ||
# Whether to configure the token or SSH key with the local git config | ||
# Default: true | ||
persist-credentials: false # <--- checking this in commit context | ||
|
||
- uses: oven-sh/setup-bun@v1 | ||
|
||
- name: "Install dependencies" | ||
run: bun install | ||
- name: "Deploy target: staging" | ||
run: bun run build && bun run generate | ||
# TODO: ask about below | ||
# env: | ||
# RUDDERSTACK_WRITE_KEY: "${{ secrets.RUDDERSTACK_WRITE_KEY }}" | ||
# RUDDERSTACK_DATA_PLANE_URL: "${{ secrets.RUDDERSTACK_DATA_PLANE_URL }}" | ||
|
||
- uses: matter-labs/action-hosting-deploy@main | ||
with: | ||
repoToken: "${{ secrets.GITHUB_TOKEN }}" | ||
firebaseServiceAccount: "${{ secrets.FIREBASE_SERVICE_ACCOUNT_ZKSYNC_DOCS }}" | ||
target: prod | ||
projectId: zksync-docs | ||
channelId: live | ||
|
||
# TODO: re-enable once we are closer to production deployment | ||
# - name: Purge cf cache | ||
# uses: nathanvaughn/actions-cloudflare-purge@db8c58f61ba4c3ec77229c8fa14ddebb3b59932f # v3.1.0 | ||
# with: | ||
# cf_zone: ${{ secrets.CLOUDFLARE_ZONE }} | ||
# cf_auth: ${{ secrets.CLOUDFLARE_AUTH_KEY }} | ||
# hosts: | | ||
# docs.zksync.io | ||
# era.zksync.io | ||
# v2-docs.zksync.io | ||
|
||
# TODO: Implement reindex task tracking instead of blindly exiting on task submit | ||
# - name: Trigger Algolia reindex | ||
# run: | | ||
# curl -X POST "${{ secrets.ALGOLIA_CRAWLER_BASE_URL }}/crawlers/${{ secrets.ALGOLIA_CRAWLER_ID }}/reindex" \ | ||
# -H "Content-Type: application/json" \ | ||
# --user "${{ secrets.ALGOLIA_CRAWLER_USER_ID }}:${{ secrets.ALGOLIA_CRAWLER_API_KEY }}" |
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,30 @@ | ||
name: "deploy staging 🏗️" | ||
on: | ||
push: | ||
branches: [staging] | ||
|
||
jobs: | ||
build_and_deploy: | ||
env: | ||
NUXT_UI_PRO_LICENSE: ${{ secrets.NUXT_UI_PRO_LICENSE }} | ||
NUXT_PUBLIC_SITE_URL: ${{ secrets.NUXT_PUBLIC_SITE_URL }} | ||
if: ${{ github.event.repository.full_name == github.repository }} | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 # v4 | ||
with: | ||
ref: "${{ github.event.inputs.ref }}" | ||
|
||
- uses: oven-sh/setup-bun@v1 | ||
|
||
- name: "Install dependencies" | ||
run: bun install | ||
- name: "Deploy target: staging" | ||
run: bun run build && bun run generate | ||
|
||
- uses: matter-labs/action-hosting-deploy@main | ||
with: | ||
repoToken: "${{ secrets.GITHUB_TOKEN }}" | ||
firebaseServiceAccount: "${{ secrets.FIREBASE_SERVICE_ACCOUNT_ZKSYNC_DOCS_STAGING_5EB09 }}" | ||
projectId: zksync-docs-staging-5eb09 | ||
channelId: live |
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
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 |
---|---|---|
|
@@ -99,3 +99,4 @@ yarn.lock | |
.nitro | ||
.cache | ||
dist | ||
.firebase |
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
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
File renamed without changes.
File renamed without changes.
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
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
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,6 @@ | ||
{ | ||
"hosting": { | ||
"public": ".output/public", | ||
"ignore": ["firebase.json", "**/.*", "**/node_modules/**"] | ||
} | ||
} |
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 |
---|---|---|
|
@@ -54,4 +54,9 @@ export default defineNuxtConfig({ | |
}, | ||
}, | ||
}, | ||
nitro: { | ||
firebase: { | ||
gen: 2, | ||
}, | ||
}, | ||
}); |
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
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,3 +1,3 @@ | ||
<script setup lang="ts"></script> | ||
|
||
<template>This is the about page.</template> | ||
<template><div>This is the about page.</div></template> |
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