From 735382264ed104ab84da660c97cb30ff7b77be1e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karolis=20Vy=C4=8Dius?= Date: Thu, 18 Jul 2024 09:10:16 +0300 Subject: [PATCH] Upload to Cloudflare pages --- .github/workflows/ci.yml | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a791aec..60292f8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -28,6 +28,8 @@ jobs: name: Validate if docker image builds runs-on: ubuntu-latest timeout-minutes: 30 + permissions: + contents: read steps: - name: Checkout code uses: actions/checkout@v4 @@ -43,6 +45,8 @@ jobs: name: Generate ReDoc runs-on: ubuntu-latest timeout-minutes: 15 + permissions: + contents: read steps: - name: Checkout code uses: actions/checkout@v4 @@ -73,7 +77,6 @@ jobs: path: openapi.json if-no-files-found: error - - name: Upload redoc-static.html artifact uses: actions/upload-artifact@v4 with: @@ -81,3 +84,15 @@ jobs: path: redoc-static.html if-no-files-found: error + - name: Create dist folder with files + run: | + mkdir dist + cp redoc-static.html dist/index.html + cp openapi.yaml openapi.json dist + + - name: Upload to Cloudflare pages + uses: cloudflare/wrangler-action@v3 + with: + apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} + accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} + command: pages deploy dist --project-name=national-boundaries-api