Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update CI from deprecated pages action to Wrangler action #260

Merged
merged 2 commits into from
Nov 29, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions .github/workflows/publish-website.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,16 +42,14 @@ jobs:
path: functions
run-id: ${{ env.GITHUB_RUN_ID }}
github-token: ${{ env.GITHUB_TOKEN }}
# The following hack is required because Cloudflare can't compile the workeers in the functions/ directory seperately from deploying, so it needs the packages they use in order to compile them at deployment time, but installing *everything* in package.json would be a waste. The build and publish steps can't go in the same job, because PR Previews have to build the site without publishing it (since they can't access secrets). Hopefully we can remove the need for this in the future by switching to Astro Actions, which should be compiled with the rest of the site.

# The following hack is required because Cloudflare can't compile the workers in the functions/ directory separately from deploying, so it needs the packages they use in order to compile them at deployment time, but installing *everything* in package.json would be a waste. The build and publish steps can't go in the same job, because PR Previews have to build the site without publishing it (since they can't access secrets). Hopefully we can remove the need for this in the future by switching to Astro Actions, which should be compiled with the rest of the site.
- name: Install packages required by functions
run: npm install xml-js semver-sort string_decoder buffer
- name: Publish to Cloudflare Pages
id: cloudflare-publish # This step needs an ID because its outputs may be needed in subsequent jobs.
uses: cloudflare/pages-action@v1
uses: cloudflare/wrangler-action@v3
with:
apiToken: ${{ env.CLOUDFLARE_API_TOKEN }}
accountId: ${{ env.CLOUDFLARE_ACCOUNT_ID }}
projectName: quiltmc-org
directory: dist
branch: ${{ inputs.branch }}
command: pages deploy dist --project-name quiltmc-org --branch ${{ inputs.branch }}