Merge pull request #2 from blockgroot/wallet-fix #3
This file contains hidden or 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
| name: deploy - nextjs | |
| on: | |
| push: | |
| branches: | |
| - main | |
| - testnet | |
| - beta | |
| jobs: | |
| nextjs: | |
| runs-on: ubuntu-latest | |
| env: | |
| VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }} | |
| VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }} | |
| VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }} | |
| steps: | |
| - uses: actions/checkout@v2 | |
| - uses: actions/setup-node@v1 | |
| with: | |
| node-version: 14 | |
| - name: Extract branch name | |
| shell: bash | |
| run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})" | |
| id: extract_branch | |
| - name: save env variable | |
| id: saveEnv | |
| run: echo "NEXT_PUBLIC_GIT_REF=${{ steps.extract_branch.outputs.branch }}" > .env | |
| - run: cat .env | |
| - name: get isProd | |
| id: isProd | |
| uses: notiz-dev/github-action-json-property@release | |
| with: | |
| path: "./deploy.json" | |
| prop_path: "${{ steps.extract_branch.outputs.branch }}.isProd" | |
| - name: get alias | |
| id: alias | |
| uses: notiz-dev/github-action-json-property@release | |
| with: | |
| path: "./deploy.json" | |
| prop_path: "${{ steps.extract_branch.outputs.branch }}.alias" | |
| - name: "Install vercel" | |
| run: npm i -g vercel | |
| - name: "Deploy to vercel" | |
| id: deploy | |
| run: | | |
| prodRun="" | |
| if [[ ${{steps.isProd.outputs.prop}} == "true" ]]; then | |
| prodRun="--prod" | |
| fi | |
| echo $prodRun | |
| echo "::set-output name=DEPLOYMENT_URL::$(vercel --confirm -t $VERCEL_TOKEN --scope $VERCEL_ORG_ID $prodRun)" | |
| - name: "Set alias" | |
| run: | | |
| echo ${{steps.alias.outputs.prop}} | |
| vercel alias set ${{ steps.deploy.outputs.DEPLOYMENT_URL }} ${{steps.alias.outputs.prop}} -t $VERCEL_TOKEN --scope $VERCEL_ORG_ID |