mirror of
https://github.com/DarkFlippers/unleashed-firmware
synced 2024-11-10 15:04:19 +00:00
github: additional pre-upload checks for doxygen workflow (#3526)
Co-authored-by: あく <alleteam@gmail.com>
This commit is contained in:
parent
bf769ee398
commit
763e2f5bab
1 changed files with 20 additions and 4 deletions
24
.github/workflows/docs.yml
vendored
24
.github/workflows/docs.yml
vendored
|
@ -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"
|
||||
|
||||
|
|
Loading…
Reference in a new issue