Skip to content

Commit

Permalink
Merge branch 'main' into 1.x
Browse files Browse the repository at this point in the history
  • Loading branch information
pookmish committed Oct 8, 2024
2 parents 7e14a95 + 2aa57da commit d43dff9
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 4 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# .github/workflows/release.yml
name: Release

on:
pull_request:
types: [closed]

jobs:
build:
runs-on: ubuntu-latest
permissions: write-all
if: github.event.pull_request.merged
steps:
- name: Get Next Release
id: tag
uses: K-Phoen/semver-release-action@master
with:
release_strategy: none
release_branch: main
tag_format: "%major%.%minor%.%patch%"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- run: echo 'Creating new release for ' ${{ steps.tag.outputs.tag }}
- name: Create Release
if: ${{ steps.tag.outputs.tag }}
uses: ncipollo/release-action@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
name: ${{ steps.tag.outputs.tag }}
tag: ${{ steps.tag.outputs.tag }}
commit: ${{ github.sha }}
generateReleaseNotes: true
makeLatest: true

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ To learn more about Next.js, take a look at the following resources:

You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js/) - your feedback and contributions are welcome!

## Deploy on Vercel
## Deploy on Vercel (main)

The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js.

Expand Down
2 changes: 1 addition & 1 deletion app/api/revalidate/route.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {getEntityFromPath} from "@lib/gql/gql-queries"

export const revalidate = 0

const getHomePagePath = nextCache(
export const getHomePagePath = nextCache(
async () => {
const {entity} = await getEntityFromPath("/")
return entity?.path
Expand Down
6 changes: 4 additions & 2 deletions app/sitemap.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import {MetadataRoute} from "next"
import {graphqlClient} from "@lib/gql/gql-client"
import {NodeUnion} from "@lib/gql/__generated__/drupal"
import {getHomePagePath} from "./api/revalidate/route"

// https://nextjs.org/docs/app/api-reference/file-conventions/route-segment-config
export const revalidate = 25200
export const revalidate = 604800
export const dynamic = "force-static"

const Sitemap = async (): Promise<MetadataRoute.Sitemap> => {
Expand All @@ -15,9 +16,10 @@ const Sitemap = async (): Promise<MetadataRoute.Sitemap> => {

const sitemap: MetadataRoute.Sitemap = []

const homePath = await getHomePagePath()
nodes.map(node =>
sitemap.push({
url: `https://summer.stanford.edu${node.path}`,
url: `https://summer.stanford.edu` + (homePath === node.path ? "/" : node.path),
lastModified: new Date(node.changed.time),
priority: node.__typename === "NodeStanfordPage" ? 1 : 0.8,
changeFrequency: node.__typename === "NodeStanfordPage" ? "weekly" : "monthly",
Expand Down

0 comments on commit d43dff9

Please sign in to comment.