Skip to content

Commit

Permalink
Added deploy code
Browse files Browse the repository at this point in the history
  • Loading branch information
George Moon committed Aug 22, 2023
1 parent 0eb1145 commit be6848b
Show file tree
Hide file tree
Showing 2 changed files with 66 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .env
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
SITE_URL=https://example.org
SITE_URL=https://geocam.natural-solutions.eu
NEXT_PUBLIC_GITHUB_USER=naturalsolutions
NEXT_PUBLIC_GITHUB_URL=https://github.com/naturalsolutions
65 changes: 65 additions & 0 deletions .github/workflows/check_build_deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: Check, Build and Deploy

on:
push:
branches: [main]
workflow_dispatch:

permissions:
contents: read
pages: write
id-token: write

concurrency:
group: "pages"
cancel-in-progress: false

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup pnpm
uses: pnpm/action-setup@v2
with:
version: latest
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: "18"
cache: "pnpm"
- name: Setup Pages
uses: actions/configure-pages@v3
with: # Automatic config for Next.js
static_site_generator: next
- name: Restore cache
uses: actions/cache@v3
with:
path: |
.next/cache
# Generate a new cache whenever packages or source files change.
key: ${{ runner.os }}-nextjs-${{ hashFiles('**/pnpm-lock.yaml') }}-${{ hashFiles('**.[jt]s', '**.[jt]sx') }}
# If source files changed but packages didn't, rebuild from a prior cache.
restore-keys: |
${{ runner.os }}-nextjs-${{ hashFiles('**/pnpm-lock.yaml') }}-
- name: Install dependencies
run: pnpm install
- name: Check code style
run: pnpm dlx prettier@latest --check src/
- name: Build
run: pnpm build
- name: Upload artifact
uses: actions/upload-pages-artifact@v1
with:
path: ./out
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2

0 comments on commit be6848b

Please sign in to comment.