From 1793b2232f218e548a4d78c094999a7d2f489393 Mon Sep 17 00:00:00 2001 From: Simon Erlic Date: Sun, 16 Jun 2024 22:27:33 -0700 Subject: [PATCH] Update deployment workflow to use Cloudflare Pages --- .github/workflows/deploy.yml | 45 ++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 .github/workflows/deploy.yml diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..e49f51b --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,45 @@ +name: Deploy site + +on: + push: + branches: + - master + workflow_dispatch: + +permissions: + contents: read + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Setup Node.js + uses: actions/setup-node@v2 + with: + node-version: "14" + - name: Install dependencies + run: npm install + - name: Build + run: npm run build + + deploy: + runs-on: ubuntu-latest + needs: build + permissions: + contents: read + deployments: write + steps: + - uses: actions/checkout@v4 + - name: Publish to Cloudflare Pages + uses: cloudflare/pages-action@v1 + with: + apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} + accountId: ${{ env.CLOUDFLARE_ACCOUNT_ID }} + projectName: website + directory: ./dist + # Optional: Enable this if you want to have GitHub Deployments triggered + gitHubToken: ${{ secrets.GITHUB_TOKEN }} + # Optional: Switch what branch you are publishing to. + # By default this will be the branch which triggered this workflow + branch: main