diff --git a/.firebaserc b/.firebaserc new file mode 100644 index 000000000..3000e57d7 --- /dev/null +++ b/.firebaserc @@ -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" + ] + } + } + } +} diff --git a/.github/workflows/feature.yml b/.github/workflows/feature.yml new file mode 100644 index 000000000..655486538 --- /dev/null +++ b/.github/workflows/feature.yml @@ -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 diff --git a/.github/workflows/lint-pr-title.yml b/.github/workflows/lint-pr-title.yml new file mode 100644 index 000000000..396ca8d90 --- /dev/null +++ b/.github/workflows/lint-pr-title.yml @@ -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 }} diff --git a/firebase.json b/firebase.json new file mode 100644 index 000000000..414313461 --- /dev/null +++ b/firebase.json @@ -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" + } + } +}