-
-
Notifications
You must be signed in to change notification settings - Fork 1
67 lines (53 loc) · 1.82 KB
/
test-and-release.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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
name: Test and Release
on: push
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PUBLIC_STORAGE_URL: https://storage.needs-assessment.distributeaid.dev/
PUBLIC_DEFAULT_FORM_URL: https://storage.needs-assessment.distributeaid.dev/form/01FX5CZCM5FZ0K0EPKJJB1RPS6
DOMAIN: needs-assessment.distributeaid.dev
jobs:
test-and-release:
runs-on: ubuntu-latest
environment: production
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: "16.x"
- name: Keep npm cache around to speed up installs
uses: actions/cache@v3
with:
path: ~/.npm
key: ${{ runner.OS }}-build-${{ hashFiles('**/package-lock.json') }}
- name: Install dependencies
run: npm ci --no-audit
- name: Compile TypeScript
run: npx tsc
- name: Run unit tests
run: npm test
- name: Build
env:
PUBLIC_VERSION: ${{ github.sha }}
run: npm run build
- uses: actions/upload-artifact@v3
if: always()
with:
name: needs-assessment-${{ github.sha }}
path: build
- 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 build
touch .nojekyll
echo ${{ env.DOMAIN }} > CNAME
git init
git add -A
git commit -m "update web app"
git remote add origin https://github.com/${GITHUB_REPOSITORY}.git
git push -f origin HEAD:gh-pages
- name: Semantic release
continue-on-error: true
run: npx semantic-release