diff --git a/.github/workflows/lint-test-build-web.yml b/.github/workflows/lint-test-build-web.yml new file mode 100644 index 000000000..641cec0c4 --- /dev/null +++ b/.github/workflows/lint-test-build-web.yml @@ -0,0 +1,74 @@ +name: Lint, Test, and Build Web Components + +on: + workflow_dispatch: + +jobs: + lint-web: + defaults: + run: + working-directory: web + runs-on: ubuntu-latest + steps: + - name: Checkout repo + uses: actions/checkout@v3 + + - name: Create env file + run: | + touch .env + echo VITE_ACCOUNT=${{ vars.VITE_ACCOUNT }} >> .env + echo VITE_CONNECT=${{ vars.VITE_CONNECT }} >> .env + echo VITE_UNRAID_NET=${{ vars.VITE_UNRAID_NET }} >> .env + echo VITE_CALLBACK_KEY=${{ vars.VITE_CALLBACK_KEY }} >> .env + cat .env + + - name: Install node + uses: actions/setup-node@v3 + with: + cache: "npm" + cache-dependency-path: "web/package-lock.json" + node-version-file: "web/.nvmrc" + + - name: Installing node deps + run: npm install + + - name: Lint files + run: npm run lint + + build-web: + defaults: + run: + working-directory: web + runs-on: ubuntu-latest + needs: [lint-web] + steps: + - name: Checkout repo + uses: actions/checkout@v3 + + - name: Create env file + run: | + touch .env + echo VITE_ACCOUNT=${{ vars.VITE_ACCOUNT }} >> .env + echo VITE_CONNECT=${{ vars.VITE_CONNECT }} >> .env + echo VITE_UNRAID_NET=${{ vars.VITE_UNRAID_NET }} >> .env + echo VITE_CALLBACK_KEY=${{ vars.VITE_CALLBACK_KEY }} >> .env + cat .env + + - name: Install node + uses: actions/setup-node@v3 + with: + cache: "npm" + cache-dependency-path: "web/package-lock.json" + node-version-file: "web/.nvmrc" + + - name: Installing node deps + run: npm install + + - name: Build + run: npm run build + + - name: Upload build to Github artifacts + uses: actions/upload-artifact@v3 + with: + name: unraid-web + path: web/.nuxt/nuxt-custom-elements/dist/unraid-components diff --git a/.github/workflows/pull-request-web.yml b/.github/workflows/pull-request-web.yml index 688f8935f..98e1355e8 100644 --- a/.github/workflows/pull-request-web.yml +++ b/.github/workflows/pull-request-web.yml @@ -16,65 +16,5 @@ jobs: working-directory: web runs-on: ubuntu-latest steps: - - name: Checkout repo - uses: actions/checkout@v3 - - - name: Create env file - run: | - touch .env - echo VITE_ACCOUNT=${{ vars.VITE_ACCOUNT }} >> .env - echo VITE_CONNECT=${{ vars.VITE_CONNECT }} >> .env - echo VITE_UNRAID_NET=${{ vars.VITE_UNRAID_NET }} >> .env - echo VITE_CALLBACK_KEY=${{ vars.VITE_CALLBACK_KEY }} >> .env - cat .env - - - name: Install node - uses: actions/setup-node@v3 - with: - cache: "npm" - cache-dependency-path: "web/package-lock.json" - node-version-file: "web/.nvmrc" - - - name: Installing node deps - run: npm install - - - name: Lint files - run: npm run lint - - build-web: - defaults: - run: - working-directory: web - runs-on: ubuntu-latest - needs: [lint-web] - steps: - - name: Checkout repo - uses: actions/checkout@v3 - - - name: Create env file - run: | - touch .env - echo VITE_ACCOUNT=${{ vars.VITE_ACCOUNT }} >> .env - echo VITE_CONNECT=${{ vars.VITE_CONNECT }} >> .env - echo VITE_UNRAID_NET=${{ vars.VITE_UNRAID_NET }} >> .env - echo VITE_CALLBACK_KEY=${{ vars.VITE_CALLBACK_KEY }} >> .env - cat .env - - - name: Install node - uses: actions/setup-node@v3 - with: - cache: "npm" - cache-dependency-path: "web/package-lock.json" - node-version-file: "web/.nvmrc" - - - name: Installing node deps - run: npm install - - - name: Build - run: npm run build - - - name: Upload build to Github artifacts - uses: actions/upload-artifact@v3 - with: - name: unraid-web - path: web/.nuxt/nuxt-custom-elements/dist/unraid-components + - name: Lint, Test, and Build Web Components + uses: unraid/lint-test-build-web