-
Notifications
You must be signed in to change notification settings - Fork 0
40 lines (38 loc) · 1.17 KB
/
publishToGHPages.yml
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
name: Publish to Github Pages
on:
push:
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v4
with:
node-version: "20.x"
cache: "npm"
- name: Install dependencies
run: npm ci --no-audit
- name: Compile TypeScript
run: npx tsc
- name: Generate assets
run: |
mkdir assets
node dist/generate-assets.js
- name: Run Unit Tests
run: npm test
- uses: actions/upload-artifact@v4
with:
name: nrfprogrammer-firmware-images-${{ github.sha }}
path: assets
- name: Publish to GitHub pages
if: github.ref == 'refs/heads/saga'
run: |
echo "machine github.com login accesskey password ${{ secrets.GITHUB_TOKEN }}" > ~/.netrc
git config --global user.email "[email protected]"
git config --global user.name "GitHub Actions"
cd assets
git init
git add -A
git commit -m "update assets"
git remote add origin https://github.com/${GITHUB_REPOSITORY}.git
git push -f origin HEAD:gh-pages