-
Notifications
You must be signed in to change notification settings - Fork 1
36 lines (29 loc) · 1.46 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
32
33
34
35
36
name: CI
on: [push, workflow_dispatch]
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Build Docker image
run: |
docker build ./ -t harness-vue-ci --no-cache --rm
docker run -d -t --name harness-vue-ci harness-vue-ci:latest /bin/sh
- name: Lint app
run: |
docker exec -t harness-vue-ci npm run lint --no-fix --no-error-on-unmatched-pattern
- name: Test app
run: |
docker exec -t harness-vue-ci npm run test
- name: Build and Deploy Docs
if: (github.event_name == 'push' && github.ref == 'refs/heads/main') || github.event_name == 'workflow_dispatch'
run: |
docker exec -t harness-vue-ci npm run docs:generate
docker exec -t harness-vue-ci npm run docs:build
docker exec -t harness-vue-ci aws configure set region us-east-1
docker exec -t harness-vue-ci aws configure set aws_access_key_id ${{ secrets.S3_ONLY_AWS_ACCESS_KEY_ID }}
docker exec -t harness-vue-ci aws configure set aws_secret_access_key ${{ secrets.S3_ONLY_AWS_SECRET_ACCESS_KEY }}
docker exec -t harness-vue-ci aws s3 rm s3://harness-docs --recursive
docker exec -t harness-vue-ci aws s3 sync docs/.vitepress/dist s3://harness-docs
docker exec -t harness-vue-ci aws cloudfront create-invalidation --distribution-id E3K46T9KULV7VZ --paths "/*"