github.com/ethersphere/bee/v2@v2.2.0/.github/workflows/docs.yaml (about) 1 name: OpenAPI 2 3 on: 4 push: 5 branches: 6 - 'master' 7 pull_request: 8 branches: 9 - '**' 10 11 jobs: 12 build: 13 name: Preview 14 runs-on: ubuntu-latest 15 steps: 16 - name: Checkout 17 uses: actions/checkout@v4 18 with: 19 fetch-depth: '0' 20 - name: Check whether docs have changed 21 id: checkdocs 22 run: | 23 changed=false 24 git diff --name-only HEAD^ HEAD > files.txt 25 while IFS= read -r file 26 do 27 if [[ $file == openapi/* ]]; then 28 echo "detected openapi spec change" 29 changed=true 30 fi 31 done < files.txt 32 33 if [ $changed == true ] 34 then 35 echo "::set-output name=build_docs::true" 36 else 37 echo "::set-output name=build_docs::false" 38 fi 39 - name: Build the OpenAPI specs 40 if: steps.checkdocs.outputs.build_docs == 'true' 41 uses: acud/openapi-dockerized@v1 42 with: 43 build-roots: 'openapi/Swarm.yaml' 44 env: 45 AWS_ACCESS_KEY_ID: ${{ secrets.DO_AWS_ACCESS_KEY_ID }} 46 AWS_SECRET_ACCESS_KEY: ${{ secrets.DO_AWS_SECRET_ACCESS_KEY }} 47 AWS_EC2_METADATA_DISABLED: true #needed when pushing to DigitalOcean Spaces 48 AWS_ENDPOINT: fra1.digitaloceanspaces.com 49 BUCKET_NAME: swarm-openapi-specs