From 4aba221788da1bdc0fc7d2aeeeddca48b78d757d Mon Sep 17 00:00:00 2001 From: Meysam Azad Date: Thu, 5 Dec 2024 13:02:13 +0700 Subject: [PATCH] fix(CI): switch gear and deploy to pages using GH action --- .github/workflows/ci.yml | 29 +++++++++++++++++++---------- 1 file changed, 19 insertions(+), 10 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 920b0cd..f0a7f78 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -38,12 +38,17 @@ jobs: with: release-type: terraform-module - tofu-docs: + build-docs: needs: release-please if: needs.release-please.outputs.releases_created == 'true' runs-on: ubuntu-latest + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} permissions: - contents: write + contents: read + pages: write + id-token: write steps: - name: Checkout uses: actions/checkout@v4 @@ -62,15 +67,19 @@ jobs: tar -xzf terraform-docs.tar.gz chmod +x terraform-docs mv terraform-docs /usr/local/bin/terraform-docs - - name: Build the doc + - name: Prepare the docs run: ./scripts/build-docs.sh - - name: Configure git - run: | - git config --global user.name "${{ github.actor }}" - git config --global user.email "${{ github.actor }}@users.noreply.github.com" - - name: Create version - run: | - mike deploy --push --update-aliases ${{ needs.release-please.outputs.tag_name }} latest + - name: Build the docs + run: mkdocs build + - name: Setup Pages + uses: actions/configure-pages@v5 + - name: Upload artifact + uses: actions/upload-pages-artifact@v3 + with: + path: docs + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4 trivy: runs-on: ubuntu-latest