diff --git a/.github/generate-workflows.js b/.github/generate-workflows.js index 5c0945433e..5d36f67dc2 100644 --- a/.github/generate-workflows.js +++ b/.github/generate-workflows.js @@ -29,9 +29,12 @@ fs.readdirSync(inDir) Object.entries(partials).forEach(([key, val]) => { const regexText = `([ \\t]*)%${key}%`; - const spacing = contents.match(new RegExp(regexText))[1]; - val = `${spacing}${val.replace(/\n/g, '\n' + spacing)}`; - contents = contents.replace(new RegExp(regexText, 'g'), val); + const match = contents.match(new RegExp(regexText)); + if (match) { + const spacing = match[1]; + val = `${spacing}${val.replace(/\n/g, '\n' + spacing)}`; + contents = contents.replace(new RegExp(regexText, 'g'), val); + } }); contents = `### WARNING -- this file was generated by ${process.argv[1].split(path.sep).pop()}\n${contents}`; diff --git a/.github/workflows-src/pr-preview.yml b/.github/workflows-src/pr-preview.yml index 0b3921bb87..98b82f0a14 100644 --- a/.github/workflows-src/pr-preview.yml +++ b/.github/workflows-src/pr-preview.yml @@ -9,7 +9,7 @@ jobs: GH_PR_TOKEN: ${{ secrets.GH_PR_TOKEN }} GH_PR_NUM: ${{ github.event.number }} steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 # Yes, we really want to checkout the PR - run: | git fetch origin pull/$GH_PR_NUM/head:tmp @@ -26,7 +26,7 @@ jobs: GH_PR_TOKEN: ${{ secrets.GH_PR_TOKEN }} GH_PR_NUM: ${{ github.event.number }} steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - run: | git fetch origin pull/$GH_PR_NUM/head:tmp git checkout tmp diff --git a/.github/workflows-src/release.yml b/.github/workflows-src/release.yml index 3341b6907f..2225532759 100644 --- a/.github/workflows-src/release.yml +++ b/.github/workflows-src/release.yml @@ -10,9 +10,12 @@ jobs: env: GH_TOKEN: ${{ secrets.GH_TOKEN_REDALLEN }} # needs to be an admin token to get around branch protection NPM_TOKEN: ${{ secrets.NPM_TOKEN }} + GH_PR_TOKEN: ${{ secrets.GH_PR_TOKEN }} + SURGE_LOGIN: ${{ secrets.SURGE_LOGIN }} + SURGE_TOKEN: ${{ secrets.SURGE_TOKEN }} steps: - run: printenv - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 with: token: ${{ secrets.GH_TOKEN_REDALLEN }} # needs to be an admin token to get around branch protection # Injected by generate-workflows.js @@ -30,3 +33,12 @@ jobs: name: Check size of docs - run: .github/upload-staging.sh name: Upload docs to staging + - run: yarn build:extensions + name: Build extension docs + - name: Upload extension only docs + uses: dswistowski/surge-sh-action@v1 + with: + domain: 'pf-extensions-staging.patternfly.org' + project: 'build/patternfly-org/site' + login: ${{ secrets.SURGE_LOGIN }} + token: ${{ secrets.SURGE_TOKEN }} diff --git a/.github/workflows/pr-preview.yml b/.github/workflows/pr-preview.yml index bb0058382b..117fadc7c1 100644 --- a/.github/workflows/pr-preview.yml +++ b/.github/workflows/pr-preview.yml @@ -10,7 +10,7 @@ jobs: GH_PR_TOKEN: ${{ secrets.GH_PR_TOKEN }} GH_PR_NUM: ${{ github.event.number }} steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 # Yes, we really want to checkout the PR - run: | git fetch origin pull/$GH_PR_NUM/head:tmp @@ -39,7 +39,7 @@ jobs: GH_PR_TOKEN: ${{ secrets.GH_PR_TOKEN }} GH_PR_NUM: ${{ github.event.number }} steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - run: | git fetch origin pull/$GH_PR_NUM/head:tmp git checkout tmp diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 4364f7de5b..e77909e987 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,4 +1,4 @@ -### WARNING -- this file was generated by generate-workflows +### WARNING -- this file was generated by generate-workflows.js name: release on: push: @@ -11,11 +11,12 @@ jobs: env: GH_TOKEN: ${{ secrets.GH_TOKEN_REDALLEN }} # needs to be an admin token to get around branch protection NPM_TOKEN: ${{ secrets.NPM_TOKEN }} + GH_PR_TOKEN: ${{ secrets.GH_PR_TOKEN }} SURGE_LOGIN: ${{ secrets.SURGE_LOGIN }} SURGE_TOKEN: ${{ secrets.SURGE_TOKEN }} steps: - run: printenv - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 with: token: ${{ secrets.GH_TOKEN_REDALLEN }} # needs to be an admin token to get around branch protection # Injected by generate-workflows.js @@ -24,13 +25,12 @@ jobs: node-version: 22 - run: corepack enable - run: yarn install --immutable - # v6 build - uses: actions/cache@v4 id: site-cache - name: Load webpack cache + name: Load rspack cache with: path: "packages/documentation-site/.cache" - key: ${{ runner.os }}-site-${{ hashFiles('yarn.lock') }} + key: ${{ runner.os }}-${{ hashFiles('yarn.lock') }} - run: yarn build name: Build docs - run: .github/release.sh