Skip to content

Update actions usage in workflows (#6) #63

Update actions usage in workflows (#6)

Update actions usage in workflows (#6) #63

name: Deploy to Production
on:
push:
branches:
- production
workflow_dispatch:
jobs:
test:
name: Test
runs-on: ubuntu-latest
env:
NODE_OPTIONS: --unhandled-rejections=strict
steps:
- uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
cache: npm
- name: Install Dependencies
run: npm ci
- name: Run Tests
run: npm test
deploy:
name: Deploy
needs: test
runs-on: ubuntu-latest
env:
NODE_OPTIONS: --unhandled-rejections=strict
steps:
- uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
cache: npm
- name: Install Dependencies
run: npm ci
- name: Generate production.env
env:
SENTRY_AUTH_TOKEN: ${{ secrets.PRODUCTION_SENTRY_AUTH_TOKEN }}
SENTRY_ORG: ${{ secrets.PRODUCTION_SENTRY_ORG }}
SENTRY_PROJECT: ${{ secrets.PRODUCTION_SENTRY_PROJECT }}
SENTRY_DSN: ${{ secrets.PRODUCTION_SENTRY_DSN }}
run: envsubst < production.env.sample > production.env
- name: Fetch data
run: git clone https://github.com/botblock/data
- name: Publish to Production
run: npm run publish:production
env:
CF_API_TOKEN: ${{ secrets.CF_API_TOKEN }}