Skip to content
This repository has been archived by the owner on Feb 7, 2024. It is now read-only.

Commit

Permalink
sitemap generation
Browse files Browse the repository at this point in the history
  • Loading branch information
janfabian committed Jul 26, 2022
1 parent e3cb517 commit a8a521d
Show file tree
Hide file tree
Showing 4 changed files with 76 additions and 7 deletions.
25 changes: 18 additions & 7 deletions .github/workflows/storefront.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,24 +27,31 @@ jobs:
cache-dependency-path: storefront/package-lock.json
- name: Install Dependencies
run: npm ci
# SWELL_SECRET_KEY is needed to next.js SSG
- name: Copy secrets
run: |
echo >> .env.production
echo SESSION_PASSWORD="${{ secrets.SESSION_PASSWORD }}" >> .env.production
echo SWELL_SECRET_KEY="${{ secrets.SWELL_SECRET_KEY }}" >> .env.production
echo INFURA_MAINNET="${{ secrets.INFURA_MAINNET }}" >> .env.production
echo INFURA_TESTNET="${{ secrets.INFURA_TESTNET }}" >> .env.production
- name: Nextjs build
run: |
npm run build
rm -rf ./.next/cache
- name: Archive Production Artifact
- name: Archive Next.js Build Artifact
if: github.ref == 'refs/heads/main'
uses: actions/upload-artifact@master
with:
name: dist
path: storefront/.next
retention-days: 1
# public folder contains dynamically generated sitemap,
# therefore is stored as build artifact
- name: Archive Production Artifact
if: github.ref == 'refs/heads/main'
uses: actions/upload-artifact@master
with:
name: public
path: storefront/public
retention-days: 1

deploy:
name: Deploy
Expand All @@ -63,14 +70,18 @@ jobs:
cache-dependency-path: firebase/functions/package-lock.json
- name: Install Dependencies
run: npm ci --prefix firebase/functions
- name: Download Artifact
- name: Download build Artifact
uses: actions/download-artifact@master
with:
name: dist
path: firebase/functions/nextjs/.next
- name: Copy public statis assets
- name: Download public Artifact
uses: actions/download-artifact@master
with:
name: public
path: firebase/storefront-public
- name: Copy next.js config
run: |
cp -rT storefront/public firebase/storefront-public
cp ./storefront/next.config.js ./firebase/functions/nextjs/next.config.cjs
- name: Copy Envs
run: cp storefront/.env* firebase/functions/
Expand Down
7 changes: 7 additions & 0 deletions storefront/next-sitemap.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/** @type {import('next-sitemap').IConfig} */
const config = {
siteUrl: "https://brute.cz",
generateRobotsTxt: true,
};

module.exports = config;
49 changes: 49 additions & 0 deletions storefront/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions storefront/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"private": true,
"scripts": {
"build": "next build",
"postbuild": "next-sitemap",
"dev": "next dev",
"lint": "next lint",
"start": "next start",
Expand Down Expand Up @@ -39,6 +40,7 @@
"eslint-plugin-prettier": "4.2.1",
"eslint-plugin-react": "7.30.1",
"eslint-plugin-react-hooks": "4.6.0",
"next-sitemap": "3.1.13",
"prettier": "2.7.1"
}
}

0 comments on commit a8a521d

Please sign in to comment.