From 9504f93e945cff2a016eeba90b966249677223c3 Mon Sep 17 00:00:00 2001 From: Giovanni Giordano Date: Fri, 3 Jan 2020 23:01:29 +0100 Subject: [PATCH] Add deployment workflow --- .github/workflows/deploy.yml | 23 +++++++++++++++++++++++ .github/workflows/nodejs.yml | 19 ++++++++++++++++--- 2 files changed, 39 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/deploy.yml diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 00000000..79a6ab91 --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,23 @@ +name: Deploy to GitHub Pages + +on: + push: + branches: + - master +jobs: + build-and-deploy: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v1 + + - name: Build + run: | + npm ci + npm RUN build + + - name: Deploy + uses: JamesIves/github-pages-deploy-action@releases/v3 + with: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + BRANCH: gh-pages + FOLDER: BUILD \ No newline at end of file diff --git a/.github/workflows/nodejs.yml b/.github/workflows/nodejs.yml index dbfc2c97..5b723020 100644 --- a/.github/workflows/nodejs.yml +++ b/.github/workflows/nodejs.yml @@ -3,18 +3,31 @@ name: Node CI on: [push] jobs: - test: + build: runs-on: ubuntu-latest steps: - uses: actions/checkout@v1 - - uses: actions/setup-node@v1 + - name: Setup Node.js 12.x + uses: actions/setup-node@v1 with: node-version: 12.x - - name: npm install and test + + - name: Install and test run: | npm ci npm test env: CI: true + + - name: Build + run: | + npm run build + + - name: Deploy + uses: JamesIves/github-pages-deploy-action@releases/v3 + with: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + BRANCH: gh-pages + FOLDER: dist \ No newline at end of file