Skip to content
This repository has been archived by the owner on Jul 8, 2023. It is now read-only.

Commit

Permalink
Feat: Add github workflow for CI
Browse files Browse the repository at this point in the history
Migrates current ci to Github Actions and sets deploy logic for Netlify
  • Loading branch information
luisorbaiceta committed Jan 10, 2022
1 parent 63a55f7 commit cd7a060
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
version: 2.0

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [16.x]
os: [ubuntu-latest]

steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'

- run:
name: Install Dependencies
command: npm ci

- run:
name: Test
command: npm test

- run:
name: Build
command: npm run build

# Sets the branch name as environment variable
- uses: nelonoel/[email protected]
- uses: jsmrcaga/action-netlify-deploy@master
with:
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
# TODO check if head is passed correctly
NETLIFY_DEPLOY_TO_PROD: ${{ env.BRANCH_NAME == env.GITHUB_HEAD_REF }}
deploy_alias: ${{ env.BRANCH_NAME }}

0 comments on commit cd7a060

Please sign in to comment.