diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 897b06b8c4..bf3db74c87 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,5 +1,4 @@ --- - name: CI on: @@ -12,14 +11,23 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Setup Node.js - uses: actions/setup-node@v2 + uses: actions/setup-node@v4 + with: + cache: npm + node-version-file: .tool-versions + + - id: cache + name: Cache + uses: actions/cache@v4 with: - node-version: 14 + path: ./node_modules + key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} - - name: Install + - if: steps.cache.outputs.cache-hit != 'true' + name: Install run: npm ci - name: Lint @@ -31,17 +39,26 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Setup Node.js - uses: actions/setup-node@v2 + uses: actions/setup-node@v4 with: - node-version: 14 + cache: npm + node-version-file: .tool-versions - name: Setup Markdown uses: xt0rted/markdownlint-problem-matcher@v1 - - name: Install + - id: cache + name: Cache + uses: actions/cache@v4 + with: + path: ./node_modules + key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} + + - if: steps.cache.outputs.cache-hit != 'true' + name: Install run: npm ci - name: Lint @@ -52,23 +69,24 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Setup Node.js - uses: actions/setup-node@v2 + uses: actions/setup-node@v4 with: - node-version: 14 + cache: npm + node-version-file: .tool-versions - - name: Cache - id: cache + - id: cache + name: Cache uses: actions/cache@v4 with: path: ./node_modules key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} - - name: Install + - if: steps.cache.outputs.cache-hit != 'true' + name: Install run: npm ci - if: steps.cache.outputs.cache-hit != 'true' - name: Build run: npm run build diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 761d30dd0e..44370cc7a6 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -1,5 +1,4 @@ --- - name: Deploy on: @@ -8,30 +7,29 @@ on: - master jobs: - Deploy: + Build: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v2 - with: - fetch-depth: 0 + uses: actions/checkout@v4 - - name: Setup - uses: actions/setup-node@v2 + - name: Setup Node.js + uses: actions/setup-node@v4 with: - node-version: 14 + cache: npm + node-version-file: .tool-versions - - name: Cache - id: cache + - id: cache + name: Cache uses: actions/cache@v4 with: path: ./node_modules key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} - - name: Install + - if: steps.cache.outputs.cache-hit != 'true' + name: Install run: npm ci - if: steps.cache.outputs.cache-hit != 'true' - name: Build run: npm run build @@ -39,10 +37,24 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} NODE_ENV: production - - name: Deploy - uses: peaceiris/actions-gh-pages@v3 + - name: Upload + uses: actions/upload-pages-artifact@v3 with: - cname: support.system76.com - github_token: ${{ secrets.RELEASE_TOKEN }} - publish_dir: ./dist - force_orphan: true + path: dist/ + + Deploy: + needs: Build + runs-on: ubuntu-latest + + permissions: + pages: write + id-token: write + + environment: + name: Support + url: ${{ steps.deployment.outputs.page_url }} + + steps: + - id: deployment + name: Deploy + uses: actions/deploy-pages@v4 diff --git a/.tool-versions b/.tool-versions new file mode 100644 index 0000000000..eedff58c83 --- /dev/null +++ b/.tool-versions @@ -0,0 +1 @@ +nodejs 16.16.0