Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Staging Cookbook #1

Merged
merged 12 commits into from
Apr 29, 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
11 changes: 11 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# editorconfig.org
root = true

[*]
indent_size = 2
indent_style = space
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
max_line_length = off
5 changes: 5 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Production license for @nuxt/ui-pro, get one at https://ui.nuxt.com/pro/purchase
NUXT_UI_PRO_LICENSE=

# Public URL, used for OG Image when running nuxt generate
NUXT_PUBLIC_SITE_URL=
8 changes: 8 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
.output
.nuxt
*.d.ts
**/node_modules/**
**/build/**
**/dist/**
**/coverage/**
**/.*/**
22 changes: 22 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"env": {
"browser": true,
"es2021": true,
"node": true
},
"extends": ["eslint:recommended", "plugin:vue/vue3-essential", "@nuxt/eslint-config"],
"plugins": ["vue"],
"rules": {
"quote-props": ["error", "as-needed"],
"vue/html-self-closing": [
"error",
{
"html": {
"void": "always"
}
}
],
"vue/singleline-html-element-content-newline": "off",
"vue/html-self-closing": "off"
}
}
5 changes: 5 additions & 0 deletions .firebaserc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"projects": {
"default": "community-cookbook-staging"
}
}
10 changes: 10 additions & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# This CODEOWNERS file sets the individuals responsible for code in the era-test-node repository.

# These users are the default owners for everything in the repo.
# They will be requested for review when someone opens a pull request.
* @zkSync-Community-Hub/zksync-devrel

# You can also specify code owners for specific directories or files.
# For example:
# /src/ @developer1 @developer2
# /docs/ @documenter
44 changes: 44 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
---
name: Bug report
about: Use this template for reporting issues
title: ""
labels: bug
assignees: ''

---

### 🐛 Bug Report for zkSync Docs

#### 📝 Description

Provide a clear and concise description of the bug.

#### 🔄 Reproduction Steps

1. Step 1
2. Step 2
3. ...

#### 🤔 Expected Behavior

Describe what you expected to happen.

#### 😯 Current Behavior

Describe what actually happened.

#### 🖥️ Environment

- **Node version**: [e.g., v18.17.0]
- **Operating System & Version**: [e.g., Ubuntu 20.04]
- **Other relevant environment details**:

#### 📋 Additional Context

Add any other context about the problem here. If applicable, add screenshots to help explain.

#### 📎 Log Output

```
Paste any relevant log output here.
```
5 changes: 5 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
blank_issues_enabled: true
contact_links:
- name: zksync-developers Discussion
url: https://github.com/zkSync-Community-Hub/zkync-developers/discussions
about: Please provide feedback, and ask questions here.
26 changes: 26 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
---
name: Feature request
about: Use this template for requesting features
title: ""
labels: feat
assignees: ''

---

### 🌟 Feature Request

#### 📝 Description

Provide a clear and concise description of the feature you'd like to see.

#### 🤔 Rationale

Explain why this feature is important and how it benefits the project.

#### 🖼️ Mockups/Examples

If applicable, provide mockups or examples of how the feature would work.

#### 📋 Additional Context

Add any other context or information about the feature request here.
17 changes: 17 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# What :computer:
* First thing updated with this PR
* Second thing updated with this PR
* Third thing updated with this PR

# Why :hand:
* Reason why first thing was added to PR
* Reason why second thing was added to PR
* Reason why third thing was added to PR

# Evidence :camera:
Include screenshots, screen recordings, or `console` output here demonstrating that your changes work as intended

<!-- All sections below are optional. You can uncomment any section applicable to your Pull Request. -->

<!-- # Notes :memo:
* Any notes/thoughts that the reviewers should know prior to reviewing the code? -->
51 changes: 51 additions & 0 deletions .github/workflows/checks.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: check 🕵️

on:
pull_request:
branches: [main, staging]
workflow_dispatch:

jobs:
format:
name: code_format
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: oven-sh/setup-bun@v1
- 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: 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

eslint:
name: code_lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: oven-sh/setup-bun@v1
- name: Install Dependencies
run: bun install
- name: Runs ESLint
run: bun run lint:eslint
35 changes: 35 additions & 0 deletions .github/workflows/deploy-preview.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
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: preview"
run: bun run generate

- uses: untitaker/[email protected]
with:
args: .output/public/ --sources content/

- name: "Deploy preview"
uses: matter-labs/action-hosting-deploy@main
with:
repoToken: '${{ secrets.GITHUB_TOKEN }}'
firebaseServiceAccount: "${{ secrets.FIREBASE_SERVICE_ACCOUNT_COMMUNITY_COOKBOOK_STAGING }}"
projectId: community-cookbook-staging
56 changes: 56 additions & 0 deletions .github/workflows/deploy-prod.yml
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: production 🚀"
run: 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_COMMUNITY_COOKBOOK }}"
target: prod
projectId: community-cookbook
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 }}"
30 changes: 30 additions & 0 deletions .github/workflows/deploy-staging.yml
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 generate

- uses: matter-labs/action-hosting-deploy@main
with:
repoToken: "${{ secrets.GITHUB_TOKEN }}"
firebaseServiceAccount: "${{ secrets.FIREBASE_SERVICE_ACCOUNT_COMMUNITY_COOKBOOK_STAGING }}"
projectId: community-cookbook-staging
channelId: live
19 changes: 19 additions & 0 deletions .github/workflows/secrets_scanner.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: scan 🔍
on:
pull_request:
merge_group:
jobs:
secrets:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
fetch-depth: 0
- name: TruffleHog OSS
uses: trufflesecurity/trufflehog@f2a0ea0b70288cf25ba46d906034417555a207a8 # v3.69.0
with:
path: ./
base: ${{ github.event.repository.default_branch }}
head: HEAD
extra_args: --debug --only-verified
30 changes: 30 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Nuxt dev/build outputs
.output
.data
.nuxt
.nitro
.cache
dist

# Node dependencies
node_modules

# Logs
logs
*.log

# Misc
.DS_Store
.fleet
.idea

# Local env files
.env
.env.*
!.env.example

# VSC
.history

.firebase
.unlighthouse
Loading
Loading