Skip to content

Commit

Permalink
github: additional pre-upload checks for doxygen workflow (#3526)
Browse files Browse the repository at this point in the history
Co-authored-by: あく <[email protected]>
  • Loading branch information
hedger and skotopes authored Mar 25, 2024
1 parent bf769ee commit 763e2f5
Showing 1 changed file with 19 additions and 3 deletions.
22 changes: 19 additions & 3 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,26 @@ env:
DEFAULT_TARGET: f7

jobs:
check-secret:
if: ${{ github.event.pull_request.head.repo.fork == false }}
runs-on: ubuntu-latest
outputs:
s3-valid-config: ${{ steps.check.outputs.s3-valid-config }}

steps:
- name: 'Check if S3 key exists'
id: check
run: |
if [[ -z "${{ secrets.FW_DOCS_AWS_ACCESS_KEY }}" || -z "${{ secrets.FW_DOCS_AWS_SECRET_KEY }}" || -z "${{ secrets.FW_DOCS_AWS_BUCKET }}" ]]; then
echo "s3-valid-config=false" >> $GITHUB_OUTPUT;
else
echo "s3-valid-config=true" >> $GITHUB_OUTPUT;
fi
doxygen:
if: ${{ !github.event.pull_request.head.repo.fork }}
if: ${{ github.event.pull_request.head.repo.fork == false }}
runs-on: ubuntu-latest
needs: check-secret
steps:
- name: 'Wipe workspace'
run: find ./ -mount -maxdepth 1 -exec rm -rf {} \;
Expand Down Expand Up @@ -48,7 +65,7 @@ jobs:
doxyfile-path: './doxygen/Doxyfile-awesome.cfg'

- name: 'Upload documentation'
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/dev' }}
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/dev' && needs.check-secret.outputs.s3-valid-config == 'true' }}
uses: jakejarvis/[email protected]
env:
AWS_S3_BUCKET: "${{ secrets.FW_DOCS_AWS_BUCKET }}"
Expand All @@ -59,4 +76,3 @@ jobs:
DEST_DIR: "${{steps.names.outputs.branch_name}}"
with:
args: "--delete"

0 comments on commit 763e2f5

Please sign in to comment.