This repository has been archived by the owner on Jul 8, 2023. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 132
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Migrates current ci to Github Actions and sets deploy logic for Netlify
- Loading branch information
1 parent
63a55f7
commit cd7a060
Showing
1 changed file
with
39 additions
and
0 deletions.
There are no files selected for viewing
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
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 }} |