add suggestions to manage database and building contact (#1712) #719
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
name: Build | |
on: | |
push: | |
branches: [ master ] | |
jobs: | |
deploy_staging: | |
runs-on: ubuntu-latest | |
strategy: | |
max-parallel: 1 | |
env: | |
MPKIT_URL: ${{ secrets.MPKIT_URL_STAGING }} | |
MPKIT_EMAIL: ${{ secrets.MPKIT_EMAIL }} | |
MPKIT_TOKEN: ${{ secrets.MPKIT_TOKEN }} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: '20' | |
- name: Install npm dependencies | |
run: npm ci | |
- name: Build assets | |
run: npm run build | |
- name: Build graphql docs | |
run: npm run build:graphql | |
- name: Deploy to staging | |
run: npx @platformos/pos-cli deploy | |
test_staging: | |
needs: deploy_staging | |
runs-on: ubuntu-latest | |
strategy: | |
max-parallel: 1 | |
env: | |
MPKIT_URL: ${{ secrets.MPKIT_URL_STAGING }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install test framework | |
run: npm i codeceptjs @codeceptjs/configure puppeteer | |
- run: npm test | |
deploy_production: | |
needs: test_staging | |
runs-on: ubuntu-latest | |
strategy: | |
max-parallel: 1 | |
env: | |
MPKIT_URL: ${{ secrets.MPKIT_URL_PRODUCTION }} | |
MPKIT_EMAIL: ${{ secrets.MPKIT_EMAIL }} | |
MPKIT_TOKEN: ${{ secrets.MPKIT_TOKEN }} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: '20' | |
- name: Install npm dependencies | |
run: npm ci | |
- name: Build assets | |
run: npm run build | |
- name: Build graphql docs | |
run: npm run build:graphql | |
- name: Deploy production | |
run: npx @platformos/pos-cli deploy | |
- name: Warm cache | |
run: time curl $MPKIT_URL >> /dev/null | |
- run: time curl $MPKIT_URL >> /dev/null | |
- run: time curl $MPKIT_URL >> /dev/null | |
- run: time curl $MPKIT_URL >> /dev/null | |
- run: time curl $MPKIT_URL >> /dev/null | |
# lighthouse_ci: | |
# needs: deploy_production | |
# runs-on: ubuntu-latest | |
# strategy: | |
# max-parallel: 1 | |
# env: | |
# MPKIT_URL: ${{ secrets.MPKIT_URL_PRODUCTION }} | |
# LHCI_GITHUB_APP_TOKEN: ${{ secrets.LHCI_GITHUB_APP_TOKEN }} | |
# steps: | |
# - uses: actions/checkout@v4 | |
# - uses: actions/setup-node@v4 | |
# with: | |
# node-version: '20' | |
# - run: npm i -g @lhci/cli | |
# - run: lhci autorun |