66
77jobs :
88 precheck :
9+ if : ${{ github.repository == 'PaloAltoNetworks/pan.dev' }}
910 name : Precheck
1011 runs-on : ubuntu-latest
1112 permissions :
1213 contents : read
13- security-events : write
1414 outputs :
1515 is-org-member-result : ${{ steps.is-org-member.outputs.is-org-member-result }}
1616 steps :
1717 - name : Check if actor is org member
1818 id : is-org-member
1919 run : |
2020 if [[ "${{ github.actor }}" == "create-pr-on-fork-for-pan-dev[bot]" ]]; then
21- echo "is-org-member-result=null" >> "$GITHUB_OUTPUT"
21+ echo "is-org-member-result=true" >> "$GITHUB_OUTPUT"
22+ exit 0
23+ fi
24+
25+ status=$(curl -s -o /dev/null -w "%{http_code}" -H "Authorization: Bearer $GH_TOKEN" \
26+ https://api.github.com/orgs/PaloAltoNetworks/members/${{ github.actor }})
27+ if [ "$status" = "204" ]; then
28+ echo "is-org-member-result=true" >> "$GITHUB_OUTPUT"
2229 else
23- echo "is-org-member-result=$(gh api -X GET orgs/PaloAltoNetworks/memberships/${{ github.actor }} | jq -r .message) " >> "$GITHUB_OUTPUT"
30+ echo "is-org-member-result=false " >> "$GITHUB_OUTPUT"
2431 fi
25- env :
26- GH_TOKEN : ${{ secrets.READ_ORG_PAT }}
32+ env :
33+ GH_TOKEN : ${{ secrets.READ_ORG_PAT }}
2734
2835 analyze :
29- if : github.repository_owner == 'PaloAltoNetworks' && needs.precheck.outputs.is-org-member-result == 'null '
36+ if : github.repository == 'PaloAltoNetworks/pan.dev ' && needs.precheck.outputs.is-org-member-result == 'true '
3037 name : Analyze
3138 needs : precheck
32- runs-on : pan-dev-runner
39+ runs-on : ubuntu-latest
3340 permissions :
3441 contents : read
3542 security-events : write
@@ -54,10 +61,10 @@ jobs:
5461 uses : github/codeql-action/analyze@1b549b9259bda1cb5ddde3b41741a82a2d15a841 # v3
5562
5663 analyze_unsafe :
57- if : github.repository_owner == 'PaloAltoNetworks' && needs.precheck.outputs.is-org-member-result != 'null '
64+ if : github.repository == 'PaloAltoNetworks/pan.dev ' && needs.precheck.outputs.is-org-member-result == 'false '
5865 name : Analyze Unsafe
5966 needs : precheck
60- runs-on : pan-dev-runner
67+ runs-on : ubuntu-latest
6168 environment : default
6269 permissions :
6370 contents : read
8693 name : Build
8794 needs : [analyze, analyze_unsafe]
8895 if : |
89- !failure() && !cancelled() &&
96+ github.repository == 'PaloAltoNetworks/pan.dev' &&
97+ !failure() && !cancelled() &&
9098 (success('analyze') || success('analyze_unsafe'))
9199 runs-on : pan-dev-runner-xl
92100 permissions :
@@ -108,22 +116,6 @@ jobs:
108116 id : yarn-cache
109117 run : echo "YARN_CACHE_DIR=$(yarn cache dir)" >> "${GITHUB_OUTPUT}"
110118
111- # - name: Cache dependencies
112- # uses: actions/cache@v4
113- # with:
114- # path: ${{ steps.yarn-cache.outputs.YARN_CACHE_DIR }}
115- # key: ${{ runner.os }}-pandev-${{ hashFiles('**/yarn.lock') }}
116- # restore-keys: |
117- # ${{ runner.os }}-pandev-
118-
119- # - name: Cache docusaurus build
120- # uses: actions/cache@v4
121- # with:
122- # path: node_modules/.cache/webpack
123- # key: ${{ runner.os }}-pandev-pr-${{ github.event.number }}-${{ hashFiles('**/yarn.lock') }}
124- # restore-keys: |
125- # ${{ runner.os }}-pandev-pr-${{ github.event.number }}-
126-
127119 - name : Install dependencies
128120 run : yarn --prefer-offline
129121
@@ -132,9 +124,9 @@ jobs:
132124 run : |
133125 echo "Including 'netsec' in build..."
134126 if [[ -n "$PRODUCTS_INCLUDE" ]]; then
135- echo "PRODUCTS_INCLUDE=$PRODUCTS_INCLUDE,cdss,threat-vault,dns-security,iot,expedition,cloudngfw,cdl,panos,terraform,ansible,splunk,aiops-ngfw-bpa,email-dlp,dlp,ai-runtime-security " >> $GITHUB_ENV
127+ echo "PRODUCTS_INCLUDE=$PRODUCTS_INCLUDE,cdss,threat-vault,dns-security,iot,expedition,cloudngfw,cdl,panos,terraform,ansible,splunk,aiops-ngfw-bpa,email-dlp,dlp,prisma-airs " >> $GITHUB_ENV
136128 else
137- echo "PRODUCTS_INCLUDE=cdss,threat-vault,dns-security,iot,expedition,cloudngfw,cdl,panos,terraform,ansible,splunk,aiops-ngfw-bpa,email-dlp,dlp,ai-runtime-security " >> $GITHUB_ENV
129+ echo "PRODUCTS_INCLUDE=cdss,threat-vault,dns-security,iot,expedition,cloudngfw,cdl,panos,terraform,ansible,splunk,aiops-ngfw-bpa,email-dlp,dlp,prisma-airs " >> $GITHUB_ENV
138130 fi
139131
140132 - name : Include cloud
@@ -171,8 +163,23 @@ jobs:
171163 run : |
172164 echo "Building the following products: $PRODUCTS_INCLUDE"
173165
166+ # needed for fetching Hashicorp blog feed
167+ - name : Install Playwright
168+ run : |
169+ npx playwright install chromium
170+ npx playwright install-deps chromium
171+
172+ - name : Cache Playwright
173+ uses : actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4
174+ with :
175+ path : |
176+ ~/.cache/ms-playwright
177+ key : ${{ runner.os }}-playwright-${{ hashFiles('package.json') }}
178+ restore-keys : |
179+ ${{ runner.os }}-playwright-
180+
174181 - name : Build site
175- run : yarn build-github
182+ run : FEED_SOFT_FAIL=1 FEED_DEBUG=1 yarn build-github
176183
177184 - name : Zip build directory
178185 run : |
@@ -196,8 +203,13 @@ jobs:
196203 deploy :
197204 name : Deploy
198205 needs : build
199- if : ${{ !failure() && !cancelled() }}
206+ if : ${{ github.repository == 'PaloAltoNetworks/pan.dev' && !failure() && !cancelled() }}
200207 runs-on : pan-dev-runner-lg
208+ permissions :
209+ contents : read
210+ pull-requests : write
211+ checks : write
212+ id-token : write
201213
202214 steps :
203215 - name : Checkout repository
@@ -227,12 +239,26 @@ jobs:
227239 echo "Deploy directory found at: $DEPLOY_DIR"
228240 echo "DEPLOY_DIR=$DEPLOY_DIR" >> $GITHUB_ENV
229241
242+ - name : Authenticate to Google Cloud
243+ id : auth
244+ uses : google-github-actions/auth@b7593ed2efd1c1617e1b0254da33b86225adb2a5
245+ with :
246+ workload_identity_provider : ${{ secrets.WIF_PROVIDER }}
247+ service_account : ${{ secrets.WIF_SERVICE_ACCOUNT }}
248+
249+ - name : Export Google Cloud Credentials
250+ run : echo "GCP_SA_KEY=$(cat ${{ steps.auth.outputs.credentials_file_path }})" >> $GITHUB_ENV
251+
252+ - uses : actions/download-artifact@95815c38cf2ff2164869cbab79da8d1f422bc89e # v4
253+ with :
254+ name : build
255+
230256 - name : Deploy to Firebase
231257 id : deploy_preview
232- uses : FirebaseExtended/action-hosting-deploy@120e124148ab7016bec2374e5050f15051255ba2 # v0.7.1
258+ uses : FirebaseExtended/action-hosting-deploy@e2eda2e106cfa35cdbcf4ac9ddaf6c4756df2c8c # v0.10.0
233259 with :
234260 repoToken : ' ${{ secrets.GITHUB_TOKEN }}'
235- firebaseServiceAccount : ' ${{ secrets.FIREBASE_SERVICE_ACCOUNT_PAN_DEV_F1B58 }}'
261+ firebaseServiceAccount : " ${{ env.GCP_SA_KEY }}"
236262 projectId : pan-dev-f1b58
237263 expires : 30d
238264 channelId : ' pr${{ github.event.number }}'
0 commit comments