Skip to content

Commit

Permalink
deploy workflow try
Browse files Browse the repository at this point in the history
  • Loading branch information
agnlez committed May 8, 2024
1 parent ba325ec commit 1704334
Showing 1 changed file with 6 additions and 29 deletions.
35 changes: 6 additions & 29 deletions .github/workflows/publish-gh-pages.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
# Sample workflow for building and deploying a Next.js site to GitHub Pages
#
# To get started with Next.js see: https://nextjs.org/docs/getting-started
#
name: Deploy Next.js site to Pages
name: Deploy 4Growth's Coming Soon page to Pages

on:
# Runs on pushes targeting the default branch
Expand All @@ -28,34 +24,15 @@ jobs:
# Build job
build:
runs-on: ubuntu-latest
# defaults:
# run:
# working-directory: client
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Detect package manager
id: detect-package-manager
run: |
if [ -f "${{ github.workspace }}/yarn.lock" ]; then
echo "manager=yarn" >> $GITHUB_OUTPUT
echo "command=install" >> $GITHUB_OUTPUT
echo "runner=yarn" >> $GITHUB_OUTPUT
exit 0
elif [ -f "${{ github.workspace }}/package.json" ]; then
echo "manager=npm" >> $GITHUB_OUTPUT
echo "command=ci" >> $GITHUB_OUTPUT
echo "runner=npx --no-install" >> $GITHUB_OUTPUT
exit 0
else
echo "Unable to determine package manager"
exit 1
fi
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: "20"
cache: ${{ steps.detect-package-manager.outputs.manager }}
node-version-file: ./client/.nvmrc
# cache: yarn
cache-dependency-path: ./client/yarn.lock
- name: Setup Pages
uses: actions/configure-pages@v5
with:
Expand All @@ -75,9 +52,9 @@ jobs:
restore-keys: |
${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json', '**/yarn.lock') }}-
- name: Install dependencies
run: ${{ steps.detect-package-manager.outputs.manager }} ${{ steps.detect-package-manager.outputs.command }}
run: yarn install
- name: Build with Next.js
run: ${{ steps.detect-package-manager.outputs.runner }} next build
run: yarn next build
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
Expand Down

0 comments on commit 1704334

Please sign in to comment.