-
Notifications
You must be signed in to change notification settings - Fork 3
51 lines (43 loc) · 1.43 KB
/
dev-preview.yml
File metadata and controls
51 lines (43 loc) · 1.43 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
name: Dev Preview (PR)
on:
pull_request:
branches: [ main ]
permissions:
contents: read
pull-requests: write
concurrency:
group: pages-dev-preview-${{ github.event.pull_request.number }}
cancel-in-progress: true
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set ACTIVE_ENV=dev
run: |
sed -i "s/^export const ACTIVE_ENV = .*/export const ACTIVE_ENV = 'dev' \/\/ 'dev' | 'prod'/" api/config.js
echo "Configured ACTIVE_ENV to dev" && grep -n "ACTIVE_ENV" api/config.js
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.1'
bundler-cache: true
- name: Build with Jekyll
run: |
gem install bundler jekyll
jekyll build --source ./ --destination ./_site
- name: Deploy to Netlify
uses: nwtgck/actions-netlify@v3.0
with:
publish-dir: './_site'
production-deploy: false
github-token: ${{ secrets.GITHUB_TOKEN }}
deploy-message: "Deploy from PR #${{ github.event.pull_request.number }}"
enable-pull-request-comment: true
enable-commit-comment: false
overwrites-pull-request-comment: true
env:
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
timeout-minutes: 5