github: additional pre-upload checks for doxygen workflow (#3526)

Co-authored-by: あく <alleteam@gmail.com>
This commit is contained in:
hedger 2024-03-25 10:51:09 +04:00 committed by GitHub
parent bf769ee398
commit 763e2f5bab
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -11,9 +11,26 @@ env:
DEFAULT_TARGET: f7
jobs:
doxygen:
if: ${{ !github.event.pull_request.head.repo.fork }}
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 == false }}
runs-on: ubuntu-latest
needs: check-secret
steps:
- name: 'Wipe workspace'
run: find ./ -mount -maxdepth 1 -exec rm -rf {} \;
@ -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/s3-sync-action@v0.5.1
env:
AWS_S3_BUCKET: "${{ secrets.FW_DOCS_AWS_BUCKET }}"
@ -59,4 +76,3 @@ jobs:
DEST_DIR: "${{steps.names.outputs.branch_name}}"
with:
args: "--delete"