From df733ef738721dbfc3583849e8e2e493b339417c Mon Sep 17 00:00:00 2001 From: andrew Date: Tue, 12 Mar 2024 19:24:32 +0900 Subject: [PATCH] fix: static deployments --- .github/workflows/deploy-docs.yml | 42 ++++++++++++++++ .../{static.yml => deploy-homepage.yml} | 41 ---------------- .github/workflows/deploy-playground.yml | 49 +++++++++++++++++++ 3 files changed, 91 insertions(+), 41 deletions(-) create mode 100644 .github/workflows/deploy-docs.yml rename .github/workflows/{static.yml => deploy-homepage.yml} (52%) create mode 100644 .github/workflows/deploy-playground.yml diff --git a/.github/workflows/deploy-docs.yml b/.github/workflows/deploy-docs.yml new file mode 100644 index 00000000..ab7d9c49 --- /dev/null +++ b/.github/workflows/deploy-docs.yml @@ -0,0 +1,42 @@ +# Simple workflow for deploying static content to Cloudflare Pages +name: Deploy Playground + +on: + # Runs on pushes targeting the default branch + push: + branches: ["master"] + + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +jobs: + # Single deploy job since we're just deploying + deploy: + runs-on: ubuntu-latest + # Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages + permissions: + contents: read + deployments: write + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Get Environment Variables + id: dotenv + uses: falti/dotenv-action@v0.2.5 + + - name: Build Docs + run: | + yarn install + yarn build + working-directory: ./docs/ + + - name: Deploy Docs + uses: cloudflare/pages-action@v1 + with: + apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} + accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} + projectName: bebop-docs + directory: ${{github.workspace}}/docs/dist + # Optional: Enable this if you want to have GitHub Deployments triggered + gitHubToken: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/.github/workflows/static.yml b/.github/workflows/deploy-homepage.yml similarity index 52% rename from .github/workflows/static.yml rename to .github/workflows/deploy-homepage.yml index 7cc8bc67..8193e897 100644 --- a/.github/workflows/static.yml +++ b/.github/workflows/deploy-homepage.yml @@ -39,47 +39,6 @@ jobs: id: dotenv uses: falti/dotenv-action@v0.2.5 - - name: Setup .NET - uses: actions/setup-dotnet@v3 - with: - dotnet-version: "8.0.x" # SDK Version to use; x will use the latest version of the 7.0 channel - dotnet-quality: 'preview' - - - name: Build Playground - run: | - ../scripts/install-wasi.sh - yarn install - yarn build:site - working-directory: ./playground/ - - - name: Deploy Playground - uses: cloudflare/pages-action@v1 - with: - apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} - accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} - projectName: bebopc-playground - directory: ${{github.workspace}}/playground/dist - # Optional: Enable this if you want to have GitHub Deployments triggered - gitHubToken: ${{ secrets.GITHUB_TOKEN }} - - - - name: Build Docs - run: | - ../scripts/install-wasi.sh - yarn install - yarn build - working-directory: ./docs/ - - - name: Deploy Docs - uses: cloudflare/pages-action@v1 - with: - apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} - accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} - projectName: bebop-docs - directory: ${{github.workspace}}/docs/dist - # Optional: Enable this if you want to have GitHub Deployments triggered - gitHubToken: ${{ secrets.GITHUB_TOKEN }} - - name: Stage Homepage run: | sed 's/0.0.0/${{ steps.dotenv.outputs.version }}/' ${{env.TOOLS_ROOT}}/bash/install.sh > homepage/install.sh diff --git a/.github/workflows/deploy-playground.yml b/.github/workflows/deploy-playground.yml new file mode 100644 index 00000000..cd36212e --- /dev/null +++ b/.github/workflows/deploy-playground.yml @@ -0,0 +1,49 @@ +# Simple workflow for deploying static content to Cloudflare Pages +name: Deploy Playground + +on: + # Runs on pushes targeting the default branch + push: + branches: ["master"] + + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +jobs: + # Single deploy job since we're just deploying + deploy: + runs-on: ubuntu-latest + # Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages + permissions: + contents: read + deployments: write + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Get Environment Variables + id: dotenv + uses: falti/dotenv-action@v0.2.5 + + - name: Setup .NET + uses: actions/setup-dotnet@v3 + with: + dotnet-version: "8.0.x" # SDK Version to use; x will use the latest version of the 7.0 channel + dotnet-quality: 'preview' + + - name: Build Playground + run: | + ../scripts/install-wasi.sh + yarn install + yarn build:site + working-directory: ./playground/ + + - name: Deploy Playground + uses: cloudflare/pages-action@v1 + with: + apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} + accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} + projectName: bebopc-playground + directory: ${{github.workspace}}/playground/dist + # Optional: Enable this if you want to have GitHub Deployments triggered + gitHubToken: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file