Skip to content

Add new contact page. #26

Add new contact page.

Add new contact page. #26

Workflow file for this run

name: CI
on:
push:
pull_request:
types: [ opened, reopened, synchronize ]
workflow_dispatch:
env:
GITHUB_ID: ${{secrets.GITHUB_ID}}
GITHUB_SECRET: ${{secrets.GITHUB_SECRET}}
NEXTAUTH_SECRET: ${{secrets.NEXTAUTH_SECRET}}
DATABASE_URL: ${{secrets.DATABASE_URL}}
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}
jobs:
# This job will build the app and run the tests on the CI server (Github)
local:
name: Local build, test and deploy
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 18
- name: Install npm
run: npm install
# https://nextjs.org/docs/pages/api-reference/next-cli#build
- name: Create production build
run: npm run build
# https://nextjs.org/docs/pages/api-reference/next-cli#production
- name: Start production build on localhost
run: |
npm run start &
sleep 5
- name: Install npm for e2e
run: |
cd e2e
npm install
- name: Run WDIO tests against localhost
run: |
cd e2e
npm run wdio-github-local
Deploy-Preview:
name: Deploy Preview
runs-on: ubuntu-latest
needs: local
outputs:
VERCEL_URL: ${{ steps.deploy.outputs.VERCEL_URL }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 18
- name: Install npm
run: npm install
- name: Install Vercel CLI
run: npm install --global vercel@latest
- name: Pull Vercel Environment Information
run: vercel pull --yes --environment=preview --token=${{ secrets.VERCEL_TOKEN }}
- name: Build Project Artifacts
run: vercel build --prod --token=${{ secrets.VERCEL_TOKEN }}
- name: Deploy Project Artifacts to Vercel
id: deploy
run: |
echo "VERCEL_URL=$(vercel deploy --prod --prebuilt --token=${{ secrets.VERCEL_TOKEN }})" >> $GITHUB_OUTPUT
- name: Generate step summary
run: |
echo "### Deployed to Vercel! :rocket:" >> $GITHUB_STEP_SUMMARY
echo "Preview URL: ${{ steps.deploy.outputs.VERCEL_URL }}" >> $GITHUB_STEP_SUMMARY
# This job will run the E2E tests against the deployed preview
remote:
name: Remote test
runs-on: ubuntu-latest
needs: Deploy-Preview
steps:
- name: Install Chrome
uses: browser-actions/setup-chrome@v1
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 18
- name: Install npm for app
run: npm install
- name: Install npm for e2e
run: |
cd e2e
npm install
- name: Run tests
run: |
cd e2e
npm run wdio-github-remote
env:
VERCEL_URL: ${{ needs.Deploy-Preview.outputs.VERCEL_URL }}
- name: Generate step summary
run: |
echo "### All E2E tests passed on Chrome, Firefox and Edge! :rocket:" >> $GITHUB_STEP_SUMMARY
echo "Deployment URL for promotion: ${{ needs.Deploy-Preview.outputs.VERCEL_URL }}" >> $GITHUB_STEP_SUMMARY
# This job will promote the preview deployment to production
# promote:
# name: Promote deployment to production
# runs-on: ubuntu-latest
# needs: remote
#
# steps:
# - name: Checkout repository
# uses: actions/checkout@v4
#
# - name: Setup Node.js
# uses: actions/setup-node@v3
# with:
# node-version: 18
#
# - name: Install npm
# run: npm install
#
# - name: Install Vercel CLI
# run: npm install --global vercel@latest
#
# - name: Promote deployment to production
# run: vercel promote ${{ needs.Deploy-Preview.outputs.VERCEL_URL }}