Skip to content

Commit

Permalink
feat: add preview deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
JackHamer09 committed Jun 27, 2023
1 parent 153729a commit df67136
Show file tree
Hide file tree
Showing 4 changed files with 131 additions and 0 deletions.
21 changes: 21 additions & 0 deletions .firebaserc
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"projects": {
"default": "zksync-dapp-wallet-v2"
},
"targets": {
"zksync-dapp-wallet-v2": {
"hosting": {
"web": [
"zksync-dapp-wallet-v2"
]
}
},
"staging-zksync-dapp-wallet-v2": {
"hosting": {
"web": [
"staging-zksync-dapp-wallet-v2"
]
}
}
}
}
43 changes: 43 additions & 0 deletions .github/workflows/feature.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Deploy To Feature Branch
on:
pull_request:

jobs:
build:
name: Build and Test
runs-on: ubuntu-latest
outputs:
dappUrl: ${{ steps.deploy.outputs.details_url }}
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: '16'
cache: 'npm'

- name: Install dependencies
run: |
npm set-script prepare ""
npm ci --force
- name: Lint
run: |
npm run lint
- name: Build
run: |
npm run generate
- name: Deploy
uses: matter-labs/action-hosting-deploy@main
id: deploy
with:
repoToken: "${{ secrets.GITHUB_TOKEN }}"
firebaseServiceAccount: "${{ secrets.FIREBASE_SERVICE_ACCOUNT_STAGING_ZKSYNC_DAPP_WALLET_V2 }}"
projectId: staging-zksync-dapp-wallet-v2
expires: 7d
19 changes: 19 additions & 0 deletions .github/workflows/lint-pr-title.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: "Lint PR"

on:
pull_request:
types:
- opened
- edited
- synchronize

jobs:
label:
name: Validate PR title
runs-on: ubuntu-latest
steps:
- uses: amannn/action-semantic-pull-request@v4
with:
subjectPattern: ^(?![A-Z]).+$
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
48 changes: 48 additions & 0 deletions firebase.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
{
"hosting": [
{
"target": "web",
"public": "dist",
"ignore": ["firebase.json", "**/.*", "**/node_modules/**", "**/*.map"],
"rewrites": [
{
"source": "**",
"destination": "/index.html"
}
],
"headers": [
{
"source": "**",
"headers": [
{
"key": "Cache-Control",
"value": "no-cache, no-store, must-revalidate"
},
{
"key": "Referrer-Policy",
"value": "no-referrer, strict-origin-when-cross-origin"
},
{
"key": "X-Content-Type-Options",
"value": "nosniff"
},
{
"key": "X-Frame-Options",
"value": "DENY"
},
{
"key": "X-XSS-Protection",
"value": "1; mode=block"
}
]
}
]
}
],
"emulators": {
"hosting": {
"host": "localhost",
"port": "3000"
}
}
}

0 comments on commit df67136

Please sign in to comment.