From 935259a42e451403cddf698280997571a40f6dd9 Mon Sep 17 00:00:00 2001 From: Antoine BERNIER Date: Sun, 11 Aug 2024 01:36:06 +0200 Subject: [PATCH 1/4] Create docs.yml --- .github/workflows/docs.yml | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 .github/workflows/docs.yml diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml new file mode 100644 index 0000000..8803dc2 --- /dev/null +++ b/.github/workflows/docs.yml @@ -0,0 +1,35 @@ +name: Build documentation and deploy to GitHub Pages +on: + push: + branches: ['docs'] + workflow_dispatch: + +# Cancel previous run (see: https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#concurrency) +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + build: + uses: pmndrs/docs/.github/workflows/build.yml@app-router + with: + mdx: './docs' + libname: 'Uikit' + + deploy: + needs: build + runs-on: ubuntu-latest + + # Grant GITHUB_TOKEN the permissions required to make a Pages deployment + permissions: + pages: write # to deploy to Pages + id-token: write # to verify the deployment originates from an appropriate source + + # Deploy to the github-pages environment + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + + steps: + - id: deployment + uses: actions/deploy-pages@v4 From c8161ab2e97a9288f14f10fa3792dee58904846a Mon Sep 17 00:00:00 2001 From: Bela Bohlender Date: Thu, 15 Aug 2024 16:09:19 +0200 Subject: [PATCH 2/4] static workflow --- .github/workflows/docs.yml | 35 ----------------------- .github/workflows/static.yml | 55 +++++++++++++++++++++++++++--------- 2 files changed, 42 insertions(+), 48 deletions(-) delete mode 100644 .github/workflows/docs.yml diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml deleted file mode 100644 index 8803dc2..0000000 --- a/.github/workflows/docs.yml +++ /dev/null @@ -1,35 +0,0 @@ -name: Build documentation and deploy to GitHub Pages -on: - push: - branches: ['docs'] - workflow_dispatch: - -# Cancel previous run (see: https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#concurrency) -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -jobs: - build: - uses: pmndrs/docs/.github/workflows/build.yml@app-router - with: - mdx: './docs' - libname: 'Uikit' - - deploy: - needs: build - runs-on: ubuntu-latest - - # Grant GITHUB_TOKEN the permissions required to make a Pages deployment - permissions: - pages: write # to deploy to Pages - id-token: write # to verify the deployment originates from an appropriate source - - # Deploy to the github-pages environment - environment: - name: github-pages - url: ${{ steps.deployment.outputs.page_url }} - - steps: - - id: deployment - uses: actions/deploy-pages@v4 diff --git a/.github/workflows/static.yml b/.github/workflows/static.yml index 8d9b54b..38e2e85 100644 --- a/.github/workflows/static.yml +++ b/.github/workflows/static.yml @@ -6,7 +6,15 @@ on: - main jobs: - deploy-static-files: + docs: + uses: pmndrs/docs/.github/workflows/build.yml@app-router + with: + mdx: './docs' + libname: 'uikit' + basePath: '/uikit/docs' + icon: '🎨' + + examples: env: GOOGLE_FONTS_API_KEY: ${{ secrets.GOOGLE_FONTS_API_KEY }} VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }} @@ -105,7 +113,6 @@ jobs: mkdir -p public/examples/lucide mkdir -p public/examples/market mkdir -p public/examples/auth - mkdir -p public/apps/html23 cp -r ./examples/apfel/dist/* ./public/examples/apfel cp -r ./examples/card/dist/* ./public/examples/card cp -r ./examples/dashboard/dist/* ./public/examples/dashboard @@ -113,27 +120,49 @@ jobs: cp -r ./examples/lucide/dist/* ./public/examples/lucide cp -r ./examples/market/dist/* ./public/examples/market cp -r ./examples/auth/dist/* ./public/examples/auth - cp -r ./apps/html23/redirect.html ./public/apps/html23/index.html - # Deploy to GH Pages - - name: Add no jekyll - run: touch public/.nojekyll - - - name: Deploy - uses: JamesIves/github-pages-deploy-action@v4 + - name: Upload Artifact + uses: actions/upload-artifact@v4 with: - branch: gh-pages - folder: public + name: 'examples' + path: 'public/examples/' # Deploy Apps to Vercel - name: Pull Vercel Environment Information working-directory: ./apps/html23 run: vercel pull --yes --environment=production --token=${{ secrets.VERCEL_TOKEN }} - + - name: Build Project Artifacts working-directory: ./apps/html23 run: vercel build --prod --token=${{ secrets.VERCEL_TOKEN }} - + - name: Deploy Project Artifacts to Vercel working-directory: ./apps/html23 run: vercel deploy --prod --prebuilt --token=${{ secrets.VERCEL_TOKEN }} + + deploy: + runs-on: ubuntu-latest + needs: + - docs + - examples + steps: + - name: Download Examples Artifiact + uses: actions/download-artifact@v4 + with: + name: "examples" + path: "./examples" + + - name: Download Docs Artifiact + uses: actions/download-artifact@v4 + with: + name: "github-pages" + path: "./docs" + + - name: Add no jekyll + run: touch ./.nojekyll + + - name: Deploy + uses: JamesIves/github-pages-deploy-action@v4 + with: + branch: gh-pages + folder: . From bbd88042586700ba720d5f11e14f3ffbd43cf6de Mon Sep 17 00:00:00 2001 From: Bela Bohlender Date: Thu, 15 Aug 2024 16:22:06 +0200 Subject: [PATCH 3/4] give deploy step content write permission --- .github/workflows/static.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/static.yml b/.github/workflows/static.yml index 38e2e85..c49a379 100644 --- a/.github/workflows/static.yml +++ b/.github/workflows/static.yml @@ -20,8 +20,6 @@ jobs: VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }} VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }} runs-on: ubuntu-latest - permissions: - contents: write steps: - name: Install Font Forge run: sudo apt-get install -y fontforge; @@ -142,6 +140,8 @@ jobs: deploy: runs-on: ubuntu-latest + permissions: + contents: write needs: - docs - examples From 8c5c99e50cd923f87c77b4c51f581f9feb7eca34 Mon Sep 17 00:00:00 2001 From: Bela Bohlender Date: Thu, 15 Aug 2024 16:51:46 +0200 Subject: [PATCH 4/4] basePath -> base_path for docs workflow --- .github/workflows/static.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/static.yml b/.github/workflows/static.yml index c49a379..a6c2e91 100644 --- a/.github/workflows/static.yml +++ b/.github/workflows/static.yml @@ -11,7 +11,7 @@ jobs: with: mdx: './docs' libname: 'uikit' - basePath: '/uikit/docs' + base_path: '/uikit/docs' icon: '🎨' examples: