diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000000..40fbd362ee --- /dev/null +++ b/.github/workflows/ci.yml @@ -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/branch-name@v1.0.1 + - 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 }} \ No newline at end of file