Skip to content

Instantly share code, notes, and snippets.

@prashantdsala
Created July 25, 2024 14:25
Show Gist options
  • Save prashantdsala/d72e694e943e7b27648306bb8c956bf1 to your computer and use it in GitHub Desktop.
Save prashantdsala/d72e694e943e7b27648306bb8c956bf1 to your computer and use it in GitHub Desktop.
Github actions "build" part steps
# create a folder .github/workflows and file name say build.yml
# create a token from Profile settings, Developer settings, Personal access token, Token(classic)
# create secret keys in repo settings "Secrets and variables" -> "Actions"
name: Build and Deploy SSG
on:
repository_dispatch:
types: [deploy]
env:
NEXT_PUBLIC_DRUPAL_BASE_URL: ${{ secrets.NEXT_PUBLIC_DRUPAL_BASE_URL }}
NEXT_IMAGE_DOMAIN: ${{ secrets.NEXT_IMAGE_DOMAIN }}
DRUPAL_CLIENT_ID: ${{ secrets.DRUPAL_CLIENT_ID }}
DRUPAL_CLIENT_SECRET: ${{ secrets.DRUPAL_CLIENT_SECRET }}
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '20'
- name: Install dependencies
run: npm install
- name: Build the site
run: yarn build
- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: build-artifacts
path: |
out/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment