install netlify-blobs #53
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: Annie Web CI | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
jobs: | |
lint: | |
runs-on: ubuntu-latest | |
env: | |
NODE_ENV: 'test' | |
ANNIE_API_BASE_URL: 'localhost:5000/api' | |
ANNIE_CLIENT_BASE_URL: 'localhost:3000' | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Use Node.js 18.x | |
uses: actions/setup-node@v2 | |
with: | |
node-version: 18.x | |
- name: setup pnpm | |
uses: pnpm/action-setup@v2 | |
with: | |
version: 8.5.1 | |
run_install: | | |
- recursive: true | |
args: [--frozen-lockfile, --strict-peer-dependencies] | |
- args: [--global, typescript] | |
- name: Get pnpm store directory path | |
id: pnpm-store-dir-path | |
run: echo "::set-output name=dir::$(pnpm store dir)" | |
- uses: actions/cache@v2 | |
id: annie-ci-cache | |
with: | |
path: ./* | |
key: ${{ github.sha }} | |
restore-keys: | | |
${{ runner.os }}-annie- | |
- name: Run Linter for Annie-Web | |
run: pnpm lint | |
test: | |
runs-on: ubuntu-latest | |
needs: lint | |
env: | |
NODE_ENV: 'test' | |
ANNIE_API_BASE_URL: 'localhost:5000/api' | |
ANNIE_CLIENT_BASE_URL: 'localhost:3000' | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Use Node.js 18.x | |
uses: actions/setup-node@v2 | |
with: | |
node-version: 18.x | |
- name: setup pnpm | |
uses: pnpm/action-setup@v2 | |
with: | |
version: 8.5.1 | |
- uses: actions/cache@v2 | |
id: annie-ci-cache | |
with: | |
path: ./* | |
key: ${{ github.sha }} | |
restore-keys: | | |
${{ runner.os }}-annie- | |
- name: Run test for Annie Web | |
run: pnpm test | |
# deployToStaging: | |
# if: github.event_name == 'push' && github.ref == 'refs/heads/main' && | |
# runs-on: ubuntu-latest | |
# needs: test | |
# steps: | |
# - uses: actions/checkout@v2 | |
# - name: Notify slack stage build | |
# id: slack # IMPORTANT: reference this step ID value in future Slack steps | |
# env: | |
# SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} | |
# uses: voxmedia/github-action-slack-notify-build@v1 | |
# with: | |
# channel_id: C01HMJ656KV | |
# status: STARTING | |
# color: warning | |
# - uses: akhileshns/heroku-deploy@v3.12.12 # This is the action | |
# with: | |
# heroku_api_key: ${{secrets.HEROKU_API_KEY}} | |
# heroku_app_name: ${{ secrets.HEROKU_APP_NAME }} # Must be unique in Heroku | |
# heroku_email: ${{ secrets.HEROKU_EMAIL }} | |
# - name: Notify slack fail | |
# if: failure() | |
# env: | |
# SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} | |
# uses: voxmedia/github-action-slack-notify-build@v1 | |
# with: | |
# # Updates existing message from the first step | |
# message_id: ${{ steps.slack.outputs.message_id }} | |
# channel_id: C01HMJ656KV | |
# status: FAILED | |
# color: danger | |
# - name: Notify slack success | |
# if: success() | |
# env: | |
# SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} | |
# uses: voxmedia/github-action-slack-notify-build@v1 | |
# with: | |
# # Updates existing message from the first step | |
# message_id: ${{ steps.slack.outputs.message_id }} | |
# channel_id: C01HMJ656KV | |
# status: SUCCESS | |
# color: good |