Merge pull request #48 from ameyxd/posts/2025-01-07 #52
This file contains hidden or 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: Deploy Focus Time App | |
on: | |
workflow_dispatch: # Manual trigger | |
push: | |
branches: ["master", "develop"] # Added develop branch | |
pull_request: | |
branches: ["master", "develop"] # Added PR checks | |
# schedule: | |
# - cron: '0 0 * * *' # Daily at midnight UTC | |
# repository_dispatch: | |
# types: [focus-app-update] | |
jobs: | |
deploy-focus: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout main site | |
uses: actions/checkout@v4 | |
with: | |
path: main-site | |
- name: Checkout Focus Time repo | |
uses: actions/checkout@v4 | |
with: | |
repository: ameyxd/focus-time | |
token: ${{ secrets.GH_PAT }} | |
path: focus-time | |
- name: Setup Node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: "20" | |
- name: Install pnpm | |
uses: pnpm/action-setup@v2 | |
with: | |
version: 8 | |
run_install: false | |
- name: Install and build Focus Time | |
working-directory: focus-time | |
run: | | |
pnpm install --no-frozen-lockfile | |
echo "NEXT_PUBLIC_BASE_PATH=/focus" >> .env.local | |
pnpm build | |
- name: Debug build output | |
working-directory: focus-time | |
run: | | |
echo "Listing build output contents:" | |
ls -la out/ | |
- name: Copy Focus Time build to main site | |
run: | | |
rm -rf main-site/public/focus | |
mkdir -p main-site/public/focus | |
cp -r focus-time/out/* main-site/public/focus/ | |
echo "Listing focus directory contents:" | |
ls -la main-site/public/focus/ | |
- name: Create .nojekyll file | |
run: | | |
touch main-site/public/.nojekyll | |
- name: Verify files | |
run: | | |
echo "Checking if files exist in the correct location..." | |
ls -la main-site/public/focus/ | |
echo "Files are ready for deployment via the main Next.js workflow" |