diff --git a/.github/workflows/config.yaml b/.github/workflows/config.yaml new file mode 100644 index 000000000..69521e9e9 --- /dev/null +++ b/.github/workflows/config.yaml @@ -0,0 +1,77 @@ +name: Build and Configure + +on: [push, pull_request] + +jobs: + build: + runs-on: ubuntu-22.04 + + steps: + - uses: actions/checkout@v3 + - name: Use Node.js 18 + uses: actions/setup-node@v3 + with: + node-version: 18 + - run: npm ci + - name: build + run: npx webpack --mode=production + env: + PUBLIC_PATH: '/AncientBeast/' + - name: Upload build artifact + uses: actions/upload-artifact@v1 + with: + name: deploy + path: deploy + + codeanalysis: + runs-on: ubuntu-22.04 + needs: build + + steps: + - name: Checkout code + uses: actions/checkout@v2 + with: + path: /home/runner/work/AncientBeast/AncientBeast + + - run: npm ci + - name: Static Code Analysis (ESLint) + run: npm run lint > eslint-report.log + - name: Static Code Analysis (ESLint) + run: cat eslint-report.log + - name: Archive ESLint Report + uses: actions/upload-artifact@v2 + with: + name: eslint-report + path: eslint-report.log + + test: + runs-on: ubuntu-22.04 + needs: codeanalysis + + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Use Node.js 18 + uses: actions/setup-node@v2 + with: + node-version: 18 + + - name: Install dependencies + run: npm ci + + - name: Lint code + run: npm run lint + + - name: Build for testing + run: npm run build:dev + + - name: Run tests + run: npm test + + deploy: + runs-on: ubuntu-22.04 + needs: test + steps: + - name: Deploy completed + run: echo "Deploy completed" diff --git a/.github/workflows/nodejs.yml b/.github/workflows/nodejs.yml deleted file mode 100644 index 310f3b213..000000000 --- a/.github/workflows/nodejs.yml +++ /dev/null @@ -1,45 +0,0 @@ -# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node -# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions - -name: Node.js CI - -on: [push, pull_request] - -jobs: - build: - runs-on: ubuntu-22.04 - - steps: - - uses: actions/checkout@v3 - - name: Use Node.js 18 - uses: actions/setup-node@v3 - with: - node-version: 18 - - run: npm ci - - name: lint - run: npm run lint - - name: build - run: npx webpack --mode=production - env: - PUBLIC_PATH: '/AncientBeast/' - - name: Upload build artifact - uses: actions/upload-artifact@v1 - with: - name: deploy - path: deploy - - deploy: - runs-on: ubuntu-22.04 - needs: build - if: github.ref == 'refs/heads/master' - steps: - - name: Download build artifact - uses: actions/download-artifact@v1 - with: - name: deploy - # Uses: https://github.com/peaceiris/actions-gh-pages - - name: Deploy - uses: peaceiris/actions-gh-pages@v3 - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - publish_dir: ./deploy