Skip to content

Merge pull request #222 from knapsack-cloud/add-message-component #65

Merge pull request #222 from knapsack-cloud/add-message-component

Merge pull request #222 from knapsack-cloud/add-message-component #65

Workflow file for this run

# Helpful Doc Links
# Workflow syntax - https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions
# Context and expression syntax - https://help.github.com/en/actions/reference/context-and-expression-syntax-for-github-actions
name: Main
on:
push:
branches:
- main
jobs:
deploy:
name: Deploy
if: github.ref == 'refs/heads/main'
needs: [build]
runs-on: ubuntu-latest
env:
HEROKU_EMAIL: ${{ secrets.HEROKU_EMAIL }}
HEROKU_API_KEY: ${{ secrets.HEROKU_API_KEY }}
HEROKU_GIT_URL: ${{ secrets.HEROKU_GIT_URL }}
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
ref: main
- name: write auth
run: |
cat > ~/.netrc <<EOF
machine git.heroku.com
login $HEROKU_EMAIL
password $HEROKU_API_KEY
EOF
- name: git push to heroku for deploy
run: |
git remote add heroku $HEROKU_GIT_URL
git push heroku main
build:
name: Build & Release
runs-on: ubuntu-latest
steps:
- name: Use actions/checkout@v3
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: 18
- name: Handle Cache
uses: actions/cache@v3
id: cache
with:
path: |
node_modules
**/node_modules
~/.cache/yarn
key: node-deps-${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
- name: Install Dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: |
yarn install --cache-folder ~/.cache/yarn --prefer-offline --frozen-lockfile
- name: Run Full Build
run: yarn build
- name: Run Knapsack Test
run: yarn test
- name: Release
run: yarn auto shipit
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.GITHUB_TOKEN }}