forked from rai-project/mlmodelscope
-
Notifications
You must be signed in to change notification settings - Fork 2
40 lines (37 loc) · 1.26 KB
/
mlmodelscope.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: Deploy MLModelscope Staging
on:
push:
branches:
- develop
paths:
- 'src/**'
workflow_dispatch:
jobs:
publish-staging:
name: Publish Staging
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: '14'
- name: Install dependencies
run: npm ci
- name: Build
env:
REACT_APP_SITE_TITLE: "STAGING - MlModelScope"
REACT_APP_API_URL: "https://api.staging.mlmodelscope.org"
REACT_APP_TRACE_URL: "https://trace.staging.mlmodelscope.org"
REACT_APP_COMPANION_URL: "https://companion.staging.mlmodelscope.org"
REACT_APP_VERSION: ${{ github.sha }}
run: npm run build
- name: Deploy to S3
env:
AWS_ACCESS_KEY_ID: ${{ secrets.STAGING_UPDATER_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.STAGING_UPDATER_SECRET_ACCESS_KEY }}
AWS_DEFAULT_REGION: us-east-1
S3_BUCKET_NAME: staging.mlmodelscope.org
CLOUDFRONT_ID: ${{ secrets.STAGING_CLOUDFRONT_DISTRIBUTION_ID }}
run: |
aws s3 sync build s3://${S3_BUCKET_NAME}
aws cloudfront create-invalidation --distribution-id ${CLOUDFRONT_ID} --path "/*"