This repository has been archived by the owner on Feb 7, 2024. It is now read-only.
fix(deps): update dependency i18next to v23 #2615
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Storefront | |
on: | |
push: | |
pull_request: | |
repository_dispatch: | |
types: | |
- next-rebuild | |
jobs: | |
build: | |
concurrency: | |
group: ${{ github.ref }}-storefront-build | |
cancel-in-progress: true | |
name: Build | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
working-directory: storefront | |
steps: | |
- name: Checkout Repo | |
uses: actions/checkout@master | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: "18" | |
cache: "npm" | |
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 SWELL_SECRET_KEY="${{ secrets.SWELL_SECRET_KEY }}" >> .env.production | |
- name: Nextjs build | |
run: | | |
npm run build | |
rm -rf ./.next/cache | |
- 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 | |
needs: build | |
runs-on: ubuntu-latest | |
concurrency: | |
group: deploy-cloud-development | |
if: github.ref == 'refs/heads/main' | |
steps: | |
- name: Checkout Repo | |
uses: actions/checkout@master | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: "16" | |
cache: "npm" | |
cache-dependency-path: firebase/functions/package-lock.json | |
- name: Install Dependencies | |
run: npm ci --prefix firebase/functions | |
- name: Download build Artifact | |
uses: actions/download-artifact@master | |
with: | |
name: dist | |
path: firebase/functions/nextjs/.next | |
- name: Download public Artifact | |
uses: actions/download-artifact@master | |
with: | |
name: public | |
path: firebase/storefront-public | |
- name: Copy next.js config | |
run: | | |
cp ./storefront/next.config.js ./firebase/functions/nextjs/next.config.cjs | |
- name: Copy Envs | |
run: cp storefront/.env* firebase/functions/ | |
- name: Copy secrets | |
run: | | |
echo >> .env | |
echo SESSION_PASSWORD="${{ secrets.SESSION_PASSWORD }}" >> .env | |
echo SWELL_SECRET_KEY="${{ secrets.SWELL_SECRET_KEY }}" >> .env | |
echo INFURA_MAINNET="${{ secrets.INFURA_MAINNET }}" >> .env | |
echo INFURA_TESTNET="${{ secrets.INFURA_TESTNET }}" >> .env | |
working-directory: firebase/functions | |
- name: Deploy Firebase Functions | |
uses: docker://w9jds/firebase-action:master | |
with: | |
args: deploy --only functions:nextjs-server | |
env: | |
GCP_SA_KEY: ${{ secrets.GCP_SA_KEY }} | |
PROJECT_PATH: firebase | |
- name: Deploy Firebase Hosting | |
uses: w9jds/firebase-action@master | |
with: | |
args: deploy --only hosting:storefront | |
env: | |
GCP_SA_KEY: ${{ secrets.GCP_SA_KEY }} | |
PROJECT_PATH: firebase |