-
Notifications
You must be signed in to change notification settings - Fork 1
31 lines (28 loc) · 1.05 KB
/
ci.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
name: CI
on: [push, workflow_dispatch]
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: '20.x'
- run: npm ci
- run: npm run lint --no-fix --no-error-on-unmatched-pattern
- run: npm test
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.S3_ONLY_AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.S3_ONLY_AWS_SECRET_ACCESS_KEY }}
aws-region: us-east-1
- name: Build and deploy
if: (github.event_name == 'push' && github.ref == 'refs/heads/main') || github.event_name == 'workflow_dispatch'
run: |
npm run docs:generate
npm run docs:build
aws s3 rm s3://harness-docs --recursive
aws s3 sync docs/.vitepress/dist s3://harness-docs
aws cloudfront create-invalidation --distribution-id E3K46T9KULV7VZ --paths "/*"