From 9f89200a8b3f9ad5544849b4eaf191980fc3e467 Mon Sep 17 00:00:00 2001 From: babarot Date: Sat, 8 Feb 2025 12:43:30 +0900 Subject: [PATCH] Add new deploy pages workflow --- .github/workflows/pages.yaml | 68 ++++++++++++++++++++++++++++++++++++ docs/install/index.html | 41 ---------------------- 2 files changed, 68 insertions(+), 41 deletions(-) create mode 100644 .github/workflows/pages.yaml delete mode 100644 docs/install/index.html diff --git a/.github/workflows/pages.yaml b/.github/workflows/pages.yaml new file mode 100644 index 0000000..84ce8e3 --- /dev/null +++ b/.github/workflows/pages.yaml @@ -0,0 +1,68 @@ +# .github/workflows/deploy.yml +name: Deploy to GitHub Pages + +on: + push: + branches: + - main + workflow_dispatch: + +permissions: + contents: read + pages: write + id-token: write + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: '3.11' + + - name: Create install page + run: | + mkdir -p docs/install + python3 - << EOF + import html + + with open('../hack/install', 'r') as f: + content = html.escape(f.read()) + + html_template = f''' + + + Install Guide + + + +
{content}
+ + ''' + + with open('docs/install/index.html', 'w') as f: + f.write(html_template) + EOF + + - name: Upload GitHub Pages artifact + uses: actions/upload-pages-artifact@v3 + with: + path: ./docs + + deploy: + needs: build + runs-on: ubuntu-latest + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4 diff --git a/docs/install/index.html b/docs/install/index.html deleted file mode 100644 index 8e8875c..0000000 --- a/docs/install/index.html +++ /dev/null @@ -1,41 +0,0 @@ - - - - Installation - - - -
- - - -