name: docs site build and push on: push: branches: - main tags: - "**" workflow_dispatch: inputs: generateAPI: description: 'Generates API pages if set' required: false default: false type: boolean jobs: generate_api_pages: runs-on: macos-latest steps: - uses: actions/checkout@v2 - name: Install swagger-codegen if: ${{ inputs.generateAPI }} run: brew install swagger-codegen - name: Generate api pages for netbird main openapi definition if: ${{ inputs.generateAPI }} run: | npm install npm run gen - name: Commit and push changes if: ${{ inputs.generateAPI }} run: | git config --global user.email "no-reply@github.com" git config --global user.name "GitHub Actions" git add -A git commit -m "Update API pages" git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }} git push docs_build_n_push: runs-on: ubuntu-latest needs: [generate_api_pages] steps: - name: Docker meta id: meta uses: docker/metadata-action@v3 with: images: netbirdio/docs.netbird.io - name: Login to DockerHub if: github.event_name != 'pull_request' uses: docker/login-action@v1 with: username: netbirdio password: ${{ secrets.DOCKER_TOKEN }} - name: Docker build and push uses: docker/build-push-action@v2 with: file: docker/Dockerfile push: ${{ github.event_name != 'pull_request' }} tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }}