From a79cac5d4b2e20b71fec444ec87b2be33ed32459 Mon Sep 17 00:00:00 2001 From: eclipse-kuksa-bot <50741596+eclipse-kuksa-bot@users.noreply.github.com> Date: Thu, 3 Aug 2023 13:24:35 +0200 Subject: [PATCH] Updating file '.github/workflows/build-page.yml' with otterdog. --- .github/workflows/build-page.yml | 113 +++++++++++++++++++++++++++++++ 1 file changed, 113 insertions(+) create mode 100644 .github/workflows/build-page.yml diff --git a/.github/workflows/build-page.yml b/.github/workflows/build-page.yml new file mode 100644 index 0000000..e4500b7 --- /dev/null +++ b/.github/workflows/build-page.yml @@ -0,0 +1,113 @@ +name: Build GH Page + +on: + workflow_dispatch: + push: + branches: + - 'main' + paths: + - 'otterdog/*.jsonnet' + - 'otterdog/*.json' + - 'docs/*' + - 'mkdocs.yml' + - '.github/workflows/build-page.yml' + +concurrency: + group: "pages" + cancel-in-progress: false + +permissions: + contents: read + pages: write + id-token: write + +jobs: + generate-markdown: + # do not run the workflow in the template repo itself + if: ${{ !contains (github.repository, '/.eclipsefdn-template') }} + runs-on: ubuntu-latest + steps: + - name: Checkout OtterDog + run: git clone https://gitlab.eclipse.org/eclipsefdn/security/otterdog.git + + - name: Checkout EclipseFdn/otterdog-configs + uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3 + with: + repository: EclipseFdn/otterdog-configs + path: otterdog-configs + + # checkout the HEAD ref + - name: Checkout HEAD + uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3 + with: + path: ${{ github.repository_owner }} + + - name: Install jsonnet-bundler + run: | + go install -a github.com/jsonnet-bundler/jsonnet-bundler/cmd/jb@v0.5.1 + echo $(go env GOPATH)/bin >> $GITHUB_PATH + + - name: Install poetry + run: pipx install poetry + + - name: Setup Python + uses: actions/setup-python@61a6322f88396a6271a6ee3565807d608ecaddd1 # v4.7.0 + with: + python-version: '3.10' + cache: 'poetry' + + - name: Install dependencies with poetry + run: | + poetry install --only=main + working-directory: otterdog + + - name: Copy configuration from HEAD ref + run: | + mkdir -p orgs/${{ github.repository_owner }} + cp -r ../${{ github.repository_owner }}/otterdog/* orgs/${{ github.repository_owner }} + working-directory: otterdog-configs + + - name: Generate default configuration as markdown + run: ../otterdog/otterdog.sh show-default ${{ github.repository_owner }} -c otterdog.json --markdown > default.txt + working-directory: otterdog-configs + + - name: Upload default text snippet + uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3 + with: + name: default-text + path: otterdog-configs/default.txt + + build-page: + runs-on: ubuntu-latest + needs: generate-markdown + steps: + - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3 + - name: Download default-text + uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3 + with: + name: default-text + - shell: bash + run: | + cat default.txt >> ./docs/index.md + - uses: actions/setup-python@61a6322f88396a6271a6ee3565807d608ecaddd1 # v4 + with: + python-version: 3.x + cache: 'pip' + - run: pip install -r requirements.txt + - name: Build with Mkdocs + run: mkdocs build + - name: Setup Pages + uses: actions/configure-pages@f156874f8191504dae5b037505266ed5dda6c382 # v3 + - name: Upload artifact + uses: actions/upload-pages-artifact@84bb4cd4b733d5c320c9c9cfbc354937524f4d64 # v1 + + deploy: + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + runs-on: ubuntu-latest + needs: build-page + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@12ab2b16cf43a7a061fe99da74b6f8f11fb77f5b # pin@v2