From 478b84f972673fdfd175dc7802a796f7652ebaaf Mon Sep 17 00:00:00 2001 From: Dennis Kigen Date: Sun, 28 Mar 2021 23:41:38 +0300 Subject: [PATCH] Add github actions workflow --- .github/workflows/validate.yml | 61 ++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 .github/workflows/validate.yml diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml new file mode 100644 index 0000000..4f2a4bb --- /dev/null +++ b/.github/workflows/validate.yml @@ -0,0 +1,61 @@ +name: validate +on: + push: + branches: ["main"] + pull_request: + branches: ["main"] + +jobs: + build: + name: "Build" + runs-on: ubuntu-latest + steps: + - name: ⬇️ Checkout repo + uses: actions/checkout@v2 + + - name: ⎔ Setup node + uses: actions/setup-node@v1 + with: + node_version: 14 + + - run: npm install + - run: npm run lint + - run: npm run check + - run: npm run format + - run: npm run coverage + - run: npm run build -- --prod + + - name: Upload artifacts + uses: actions/upload-artifact@v2 + with: + name: dist + path: | + dist + + deploy: + name: "Deploy" + runs-on: ubuntu-latest + needs: build + steps: + - name: ⤵️ Download build artifacts from build job + uses: actions/download-artifact@v2 + with: + name: dist + - uses: actions/checkout@v1 + - uses: netlify/actions/cli@master + env: + NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }} + NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }} + with: + args: deploy --dir=build --prod + secrets: '["NETLIFY_AUTH_TOKEN", "NETLIFY_SITE_ID"]' + + codecov: + name: "Coverage" + runs-on: ubuntu-latest + needs: deploy + steps: + - uses: actions/checkout@master + - uses: codecov/codecov-action@v1 + with: + token: ${{ secrets.CODECOV_TOKEN }}