From 69368924479213e5ec8abcbbeb1de4e7ada8321b Mon Sep 17 00:00:00 2001 From: Corentin THOMASSET Date: Tue, 17 Sep 2024 21:18:36 +0200 Subject: [PATCH] chore(cd): added refined cf pages workflow (#167) --- .github/workflows/cd-app-prod.yaml | 73 ++++++++++++++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100644 .github/workflows/cd-app-prod.yaml diff --git a/.github/workflows/cd-app-prod.yaml b/.github/workflows/cd-app-prod.yaml new file mode 100644 index 00000000..bebedce1 --- /dev/null +++ b/.github/workflows/cd-app-prod.yaml @@ -0,0 +1,73 @@ +on: + push: + branches: + - main + +jobs: + publish-app: + runs-on: ubuntu-latest + permissions: + contents: read + deployments: write + name: Publish app to production + steps: + - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4 + - run: corepack enable + - uses: actions/setup-node@v4 + with: + node-version: 22 + corepack: true + cache: 'pnpm' + + - name: Install dependencies + run: pnpm i + + - name: Build the app + run: pnpm -F @enclosed/deploy-cloudflare build + + - name: Publish to Cloudflare Pages + uses: AdrianGonz97/refined-cf-pages-action@v1 + with: + apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} + accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} + githubToken: ${{ secrets.GITHUB_TOKEN }} + projectName: enclosed + workingDirectory: packages/deploy-cloudflare + directory: dist + deploymentName: Production + branch: main + wranglerVersion: '3' + + publish-docs: + runs-on: ubuntu-latest + permissions: + contents: read + deployments: write + name: Publish docs to production + steps: + - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4 + - run: corepack enable + - uses: actions/setup-node@v4 + with: + node-version: 22 + corepack: true + cache: 'pnpm' + + - name: Install dependencies + run: pnpm i + + - name: Build the app + run: pnpm -F @enclosed/docs build + + - name: Publish to Cloudflare Pages + uses: AdrianGonz97/refined-cf-pages-action@v1 + with: + apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} + accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} + githubToken: ${{ secrets.GITHUB_TOKEN }} + projectName: enclosed-docs + workingDirectory: packages/docs + directory: dist + deploymentName: Production + branch: main + wranglerVersion: '3'