1
mirror of https://github.com/DarkFlippers/unleashed-firmware.git synced 2025-12-12 12:42:30 +04:00

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

View File

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