diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 56d0c0e..dc7a476 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -1,29 +1,44 @@ -name: Auto-deployment of Documentation +name: Deploy to Github Pages on: push: - branches: [main] + branches: [ main ] + pull_request: + branches: [ main ] + workflow_dispatch: + jobs: - build-docs: + build-and-deploy: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v3.0.2 + uses: actions/checkout@v3 with: - fetch-depth: 0 # otherwise, you will failed to push refs to dest repo + fetch-depth: 0 - - name: Set up Python 3. - uses: actions/setup-python@v3 + - name: Setup Node.js + uses: actions/setup-node@v3 with: - python-version: 3.9 + node-version: '16' + cache: 'npm' + cache-dependency-path: './table-component/package-lock.json' - - name: Install Poetry. - uses: snok/install-poetry@v1.3.1 + - name: Install and Build + run: | + npm install + cd ./table-component + npm run build + env: + NODE_ENV: production - - name: Install dependencies. + - name: Copy build files run: | - poetry install --with docs + mkdir -p ../css ../js + cp ./table-component/dist/css/app*.css ../css/app.css + cp ./table-component/dist/css/chunk-vendors*.css ../css/chunk-vendors.css + cp ./table-component/dist/js/app*.js ../js/app.js + cp ./table-component/dist/js/chunk-vendors*.js ../js/chunk-vendors.js - - name: Build documentation. + - name: Prepare documentation run: | mkdir gh-pages touch gh-pages/.nojekyll @@ -35,4 +50,4 @@ jobs: with: branch: gh-pages force: true - folder: gh-pages + folder: gh-pages \ No newline at end of file