Skip to content

Commit

Permalink
Merge branch 'refs/heads/main' into privacy-policy
Browse files Browse the repository at this point in the history
  • Loading branch information
Pyrofab committed Apr 27, 2024
2 parents c880a82 + 449c26d commit ca13473
Show file tree
Hide file tree
Showing 82 changed files with 19,484 additions and 5,069 deletions.
45 changes: 35 additions & 10 deletions .github/workflows/commit-preview.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,53 @@ on: [push]
name: Commit preview

jobs:
build:
generate-preview:
name: Generate commit preview
runs-on: ubuntu-latest
permissions:
contents: read
deployments: write

name: Generate commit preview
steps:
- name: Checkout
uses: akarys42/checkout-with-filter@main
- uses: actions/checkout@v4
with:
filter: 'blob:none'
fetch-depth: 0
filter: 'blob:none'

- name: Enable Corepack shims
run: corepack enable
- name: Setup Node.js
uses: actions/setup-node@v4
with:
cache: "npm"
node-version: "20"

- name: Install dependencies
run: pnpm install
run: npm ci

- name: Build the project
run: pnpm build
run: npm run build

- name: Upload HTML artifact
uses: actions/upload-artifact@v4
with:
name: website-html
path: dist
retention-days: 1

- name: Upload Functions artifact
uses: actions/upload-artifact@v4
with:
name: website-functions
path: functions
retention-days: 1

- name: Upload package artifact
uses: actions/upload-artifact@v4
with:
name: website-package
path: |
package.json
package-lock.json
retention-days: 1

- name: Publish to Pages
uses: cloudflare/pages-action@1
Expand All @@ -35,7 +60,7 @@ jobs:
directory: dist

- name: Add a comment on the commit
uses: peter-evans/commit-comment@v1
uses: peter-evans/commit-comment@5a6f8285b8f2e8376e41fe1b563db48e6cf78c09 # v3.0.0
with:
token: ${{ secrets.COZY_PAT }}
repository: ${{ github.repository }}
Expand Down
41 changes: 33 additions & 8 deletions .github/workflows/manual-publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,52 @@ name: Manual publish

jobs:
build:
name: Publish website
runs-on: ubuntu-latest
permissions:
contents: read
deployments: write

name: Publish website
steps:
- name: Checkout
uses: akarys42/checkout-with-filter@main
- uses: actions/checkout@v4
with:
filter: 'blob:none'
fetch-depth: 0
filter: 'blob:none'

- name: Enable Corepack shims
run: corepack enable
- name: Setup Node.js
uses: actions/setup-node@v4
with:
cache: "npm"
node-version: "20"

- name: Install dependencies
run: pnpm install
run: npm ci

- name: Build the project
run: pnpm build
run: npm run build

- name: Upload HTML artifact
uses: actions/upload-artifact@v4
with:
name: website-html
path: dist
retention-days: 1

- name: Upload Functions artifact
uses: actions/upload-artifact@v4
with:
name: website-functions
path: functions
retention-days: 1

- name: Upload package artifact
uses: actions/upload-artifact@v4
with:
name: website-package
path: |
package.json
package-lock.json
retention-days: 1

- name: Publish to Pages
uses: cloudflare/pages-action@1
Expand Down
18 changes: 9 additions & 9 deletions .github/workflows/pr-preview-footer.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ name: Add footer to PR

jobs:
comment:
name: Add preview footer to PR
runs-on: ubuntu-latest

name: Add preview footer to PR
steps:
- name: Add preview footer to PR
uses: devindford/[email protected].2
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
body-template: |
---
See preview on Cloudflare Pages: https://preview-${{ github.event.number }}.quiltmc-org.pages.dev
body-update-action: 'suffix'
- name: Add preview footer to PR
uses: devindford/Append_PR_Comment@32dd2619cd96ac8da9907c416c992fe265233ca8 # v1.1.3
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
body-template: |
---
See preview on Cloudflare Pages: https://preview-${{ github.event.number }}.quiltmc-org.pages.dev
body-update-action: "suffix"
26 changes: 14 additions & 12 deletions .github/workflows/pr-preview.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,46 +3,48 @@ name: PR preview

jobs:
build:
name: Generate PR preview
runs-on: ubuntu-latest
permissions:
contents: read

name: Generate PR preview
steps:
- name: Checkout
uses: akarys42/checkout-with-filter@main
- uses: actions/checkout@v4
with:
filter: 'blob:none'
fetch-depth: 0
filter: 'blob:none'

- name: Enable Corepack shims
run: corepack enable
- name: Setup Node.js
uses: actions/setup-node@v4
with:
cache: "npm"
node-version: "20"

- name: Install dependencies
run: pnpm install
run: npm ci

- name: Build the project
run: pnpm build
run: npm run build

- name: Upload HTML artifact
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: website-html
path: dist
retention-days: 1

- name: Upload Functions artifact
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: website-functions
path: functions
retention-days: 1

- name: Upload package artifact
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: website-package
path: |
package.json
pnpm-lock.yaml
package-lock.json
retention-days: 1
20 changes: 12 additions & 8 deletions .github/workflows/publish-pr-preview.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,39 +6,43 @@ name: Publish PR preview

jobs:
publish:
name: Publish PR preview
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'success' }}

name: Publish PR preview
steps:
- name: Download HTML artifact
uses: dawidd6/action-download-artifact@v2
uses: dawidd6/action-download-artifact@09f2f74827fd3a8607589e5ad7f9398816f540fe # v3.1.4
with:
name: website-html
path: dist
run_id: ${{ github.event.workflow_run.id }}

- name: Download Functions artifact
uses: dawidd6/action-download-artifact@v2
uses: dawidd6/action-download-artifact@09f2f74827fd3a8607589e5ad7f9398816f540fe # v3.1.4
with:
name: website-functions
path: functions
run_id: ${{ github.event.workflow_run.id }}

- name: Download package artifact
uses: dawidd6/action-download-artifact@v2
uses: dawidd6/action-download-artifact@09f2f74827fd3a8607589e5ad7f9398816f540fe # v3.1.4
with:
name: website-package
run_id: ${{ github.event.workflow_run.id }}

- name: Enable Corepack shims
run: corepack enable
- name: Setup Node.js
uses: actions/setup-node@v4
with:
cache: "npm"
node-version: "20"

- name: Install dependencies
run: pnpm install
run: npm ci

# TODO this action is deprecated!
- name: Gather PR details
uses: potiuk/get-workflow-origin@v1_1
uses: potiuk/get-workflow-origin@e2dae063368361e4cd1f510e8785cd73bca9352e # v1_5 (v1_6 is broken!)
id: pr-details
with:
token: ${{ secrets.GITHUB_TOKEN }}
Expand Down
6 changes: 4 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ _site
.jekyll-metadata
vendor
node_modules
.dev.vars

# Generated by webpack
src/assets/js/bundle.js
Expand All @@ -22,11 +21,14 @@ dist
cache

# CSS from quilt-bulma
public/assets/css
public/assets/css/style*

# Generated function files
functions/*
!functions/api

# Secrets
.dev.vars

# Local development
.wrangler
1 change: 0 additions & 1 deletion .nvmrc

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ Some functionalities of the website, such as redirects or functions, use some Cl
To test these features, you can run the following command:

```sh
$ npx wrangler pages dev -- pnpm dev --host
$ npx wrangler pages dev -- npm run dev --host
```

Make sure to use the url provided by wrangler, as it will be different from the one provided by Astro. It should appear underneath `Worker reloaded!`.
Expand Down
10 changes: 9 additions & 1 deletion astro.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,19 @@ import rehypeAutolinkHeadings from 'rehype-autolink-headings';
import { fromHtml } from 'hast-util-from-html';

import compress from "astro-compress";
import searchIndex from "./src/integration/search-index";

// https://astro.build/config
export default defineConfig({
site: "https://quiltmc.org",
integrations: [mdx(), astroI18next(), sitemap(), purgecss(), compress()],
integrations: [
mdx(),
astroI18next(),
sitemap(),
purgecss({ safelist: ["has-background-info", "has-background-link"] }),
compress({ SVG: false, }),
searchIndex()
],
markdown: {
syntaxHighlight: "prism",
rehypePlugins: [[rehypeAutolinkHeadings, {
Expand Down
15 changes: 15 additions & 0 deletions functions/api/internal/download-template-mod.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
export async function onRequest(context) {
const defaultBranch = await fetch(`https://api.github.com/repos/quiltmc/quilt-template-mod`, {
headers: {
"User-Agent": "QuiltMC Website API"
}
})
.then(res => res.json())
.then(data => data.default_branch);

return fetch(`https://github.com/QuiltMC/quilt-template-mod/archive/refs/heads/${defaultBranch}.zip`, {
headers: {
"User-Agent": "QuiltMC Website API"
}
})
}
Loading

1 comment on commit ca13473

@Cozy-GitHub
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See preview on Cloudflare Pages: https://c3ff3b16.quiltmc-org.pages.dev

Please sign in to comment.