From ae469d23c034528df83e54426bffbf8afc6d3cff Mon Sep 17 00:00:00 2001 From: Stephen Leisy Date: Tue, 25 Feb 2025 11:00:39 -0800 Subject: [PATCH 1/4] Create dev branch and initial CI/CD. --- github/workflows/deploy.yml | 39 +++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 github/workflows/deploy.yml diff --git a/github/workflows/deploy.yml b/github/workflows/deploy.yml new file mode 100644 index 0000000..948e31b --- /dev/null +++ b/github/workflows/deploy.yml @@ -0,0 +1,39 @@ +name: Build and Deploy Portfolio Site + +on: + push: + branches: + - main # Runs when pushing to the 'main' branch + pull_request: + branches: + - main # Runs when creating a PR against 'main' + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Checkout Code + uses: actions/checkout@v2 # Check out the code from the repository + + - name: Set up Node.js + uses: actions/setup-node@v2 + with: + node-version: '22.14.0' # Specify your Node.js version + + - name: Install pnpm + run: npm install -g pnpm # Install pnpm globally + + - name: Install Dependencies + run: pnpm install # Use pnpm to install dependencies + + # - name: Run Tests (Optional) + # run: pnpm test + + - name: Build Project + run: pnpm run build # Build the Next.js app with pnpm + + - name: Deploy to Vercel + run: vercel --prod --token ${{ secrets.VERCEL_TOKEN }} # Deploy to Vercel + env: + VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }} # Vercel token from GitHub Secrets From f77ba4ccf5cf66d4354271c9a70c824bb0662401 Mon Sep 17 00:00:00 2001 From: Stephen Leisy Date: Tue, 25 Feb 2025 11:09:51 -0800 Subject: [PATCH 2/4] Create dev branch and initial CI/CD 2. --- {github => .github}/workflows/deploy.yml | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {github => .github}/workflows/deploy.yml (100%) diff --git a/github/workflows/deploy.yml b/.github/workflows/deploy.yml similarity index 100% rename from github/workflows/deploy.yml rename to .github/workflows/deploy.yml From 18d95393a9f80c989943d3e0b95f567480ebfe50 Mon Sep 17 00:00:00 2001 From: Stephen Leisy Date: Tue, 25 Feb 2025 11:15:41 -0800 Subject: [PATCH 3/4] Create dev branch and initial CI/CD 3. --- .github/workflows/deploy.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 948e31b..6531df7 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -33,6 +33,9 @@ jobs: - name: Build Project run: pnpm run build # Build the Next.js app with pnpm + - name: Install Vercel CLI + run: npm install -g vercel # Install Vercel CLI globally + - name: Deploy to Vercel run: vercel --prod --token ${{ secrets.VERCEL_TOKEN }} # Deploy to Vercel env: From 48efa7ffe530c3dfc5f06542552b6ead23a1b7f7 Mon Sep 17 00:00:00 2001 From: Stephen Leisy Date: Tue, 25 Feb 2025 11:23:30 -0800 Subject: [PATCH 4/4] Updates to CI/CD. --- .github/workflows/deploy.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 6531df7..adfb8d2 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -33,10 +33,16 @@ jobs: - name: Build Project run: pnpm run build # Build the Next.js app with pnpm + deploy: + runs-on: ubuntu-latest + needs: build # Ensure that the deploy step only runs after the build + + steps: - name: Install Vercel CLI run: npm install -g vercel # Install Vercel CLI globally - name: Deploy to Vercel - run: vercel --prod --token ${{ secrets.VERCEL_TOKEN }} # Deploy to Vercel + if: github.event_name == 'push' && github.ref == 'refs/heads/main' # Only deploy on push to 'main' + run: vercel --prod --token ${{ secrets.VERCEL_TOKEN }} --yes # Deploy to Vercel with auto-confirmation env: VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }} # Vercel token from GitHub Secrets