Skip to content

Commit

Permalink
feat: redo combined sitemap for new process (#750)
Browse files Browse the repository at this point in the history
  • Loading branch information
nfpappas-oddball authored Oct 2, 2024
1 parent 0cc1105 commit 161e947
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 2 deletions.
41 changes: 40 additions & 1 deletion .github/workflows/content-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,46 @@ jobs:
fi
- name: Build sitemap
run: cd main && yarn build:sitemap
run: |
cd main && yarn build:sitemap
cd out
cp sitemap.xml sitemap-nb.xml
- name: setup bucket descriptor
id: bucket-descriptor
run: |
if [ "${{ inputs.build_type }}" == 'dev' ]; then
echo NEXT_SITEMAP_LOCATION="https://s3.us-gov-west-1.amazonaws.com/next-content.dev.va.gov/sitemap-nb.xml" >> $GITHUB_OUTPUT
echo OLD_SITEMAP_LOCATION="https://s3.us-gov-west-1.amazonaws.com/content.dev.va.gov/sitemap-cb.xml" >> $GITHUB_OUTPUT
elif [ "${{ inputs.build_type }}" == 'staging'] ; then
echo NEXT_SITEMAP_LOCATION="https://s3.us-gov-west-1.amazonaws.com/next-content.staging.va.gov/sitemap-nb.xml" >> $GITHUB_OUTPUT
echo OLD_SITEMAP_LOCATION="https://s3.us-gov-west-1.amazonaws.com/content.staging.va.gov/sitemap-cb.xml" >> $GITHUB_OUTPUT
elif [ "${{ inputs.build_type }}" == 'prod' ]; then
echo NEXT_SITEMAP_LOCATION="https://s3.us-gov-west-1.amazonaws.com/next-content.www.va.gov/sitemap-nb.xml" >> $GITHUB_OUTPUT
echo OLD_SITEMAP_LOCATION="https://s3.us-gov-west-1.amazonaws.com/next-content.www.va.gov/sitemap-cb.xml" >> $GITHUB_OUTPUT
else
echo NEXT_SITEMAP_LOCATION="https://s3.us-gov-west-1.amazonaws.com/next-content.www.va.gov/sitemap-nb.xml" >> $GITHUB_OUTPUT
echo OLD_SITEMAP_LOCATION="https://s3.us-gov-west-1.amazonaws.com/next-content.www.va.gov/sitemap-cb.xml" >> $GITHUB_OUTPUT
fi
shell: bash
- name: Generate new sitemap
run: |
cd main
cd out
echo "${{steps.bucket-descriptor.outputs.OLD_SITEMAP_LOCATION}}"
cat <<'EOF' >> sitemap.xml
<?xml version="1.0" encoding="UTF-8"?>
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<sitemap>
<loc>${{steps.bucket-descriptor.outputs.NEXT_SITEMAP_LOCATION}}</loc>
</sitemap>
<sitemap>
<loc>${{steps.bucket-descriptor.outputs.OLD_SITEMAP_LOCATION}}</loc>
</sitemap>
</sitemapindex>
EOF
- name: Configure AWS Credentials
uses: aws-actions/[email protected]
Expand Down
3 changes: 2 additions & 1 deletion next-sitemap.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ const sitemapConfig = {
siteUrl: process.env.SITE_URL || 'https://localhost:8001',
// output: 'export' directory from next config
outDir: 'out',
generateIndexSitemap: true,
generateIndexSitemap: false,
sitemapSize: 100000, //set some large size in bytes so we have one sitemap.xml?
// relative paths to exclude
exclude: [],

Expand Down

0 comments on commit 161e947

Please sign in to comment.