-
Notifications
You must be signed in to change notification settings - Fork 2
38 lines (35 loc) · 1.23 KB
/
publish.yaml
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
name: Publish
on:
workflow_dispatch:
pull_request:
branches:
- main
jobs:
publish:
env:
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
- uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # v5.2.0
with:
python-version: '3.11'
- name: Install Dependencies
run: |
pip install -r requirements.txt
npm install netlify-cli -g
- name: Make top level files
run: make -C src html
- name: Assemble site
run: |
python scripts/site.py build
cp -r src/_build/html/* dist
- name: Publish to development
# Publish to preview for a PR
# Cannot publish from a fork because no access to secrets
if: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.repo.fork == false }}
run: netlify deploy --dir=dist --site=oneapi-spec
- name: Publish to production
# Publish to production when manually triggered for main
if: ${{ github.event_name == 'workflow_dispatch' || github.ref == 'refs/heads/main' }}
run: netlify deploy --dir=dist --site=oneapi-spec --prod