-
Notifications
You must be signed in to change notification settings - Fork 188
66 lines (57 loc) · 2.79 KB
/
deploy-demos-to-prod.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
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
name: Deploy Demos to Production
on:
workflow_dispatch:
jobs:
deploy-json-demos-to-production:
runs-on: ubuntu-latest
env:
AWS_REGION: ${{ secrets.aws_region }}
steps:
- name: Pull staging bucket
env:
AWS_ACCESS_KEY_ID: ${{ secrets.PL_SITE_STAGING_NON_REACT_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.PL_SITE_STAGING_NON_REACT_SECRET_ACCESS_KEY }}
AWS_S3_BUCKET_ID: ${{ secrets.PL_SITE_STAGING_QML_JSON_S3_BUCKET_ID }}
AWS_S3_HTML_BUCKET_ID: ${{ secrets.PL_SITE_STAGING_S3_BUCKET_NAME }}
run: |
aws s3 cp --recursive s3://$AWS_S3_BUCKET_ID/master ./local-master
aws s3 cp s3://$AWS_S3_HTML_BUCKET_ID/qml/searchindex.js searchindex.js
aws s3 cp s3://$AWS_S3_HTML_BUCKET_ID/qml/objects.inv objects.inv
- name: Push production bucket
env:
AWS_ACCESS_KEY_ID: ${{ secrets.PL_SITE_PROD_NON_REACT_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.PL_SITE_PROD_NON_REACT_SECRET_ACCESS_KEY }}
AWS_S3_BUCKET_ID: ${{ secrets.PL_SITE_PROD_QML_JSON_S3_BUCKET_ID }}
AWS_S3_HTML_BUCKET_ID: ${{ secrets.PL_SITE_PROD_S3_BUCKET_NAME }}
run: |
aws s3 sync ./local-master s3://$AWS_S3_BUCKET_ID/master --delete
aws s3 cp searchindex.js s3://$AWS_S3_HTML_BUCKET_ID/qml/searchindex.js
aws s3 cp objects.inv s3://$AWS_S3_HTML_BUCKET_ID/qml/objects.inv
- name: Trigger production website build
uses: peter-evans/repository-dispatch@v2
env:
RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
with:
token: ${{ secrets.PL_SITE_PROD_QML_REACT_PAT }}
repository: XanaduAI/pennylane.ai-react
event-type: build-pl-site-main
client-payload: '{"actor": "${{ github.actor }}", "triggering_actor": "${{ github.triggering_actor }}", "source_run_url": "${{ env.RUN_URL }}"}'
deploy-text-demos-to-production:
runs-on: ubuntu-latest
env:
AWS_REGION: ${{ secrets.aws_region }}
steps:
- name: Pull staging bucket
env:
AWS_ACCESS_KEY_ID: ${{ secrets.STAGING_GLASS_ONION_AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.STAGING_GLASS_ONION_AWS_SECRET_ACCESS_KEY }}
AWS_S3_BUCKET_ID: ${{ secrets.STAGING_GLASS_ONION_DEMOS_BUCKET_ID }}
run: |
aws s3 cp --recursive s3://$AWS_S3_BUCKET_ID ./demos
- name: Push production bucket
env:
AWS_ACCESS_KEY_ID: ${{ secrets.PROD_GLASS_ONION_AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.PROD_GLASS_ONION_AWS_SECRET_ACCESS_KEY }}
AWS_S3_BUCKET_ID: ${{ secrets.PROD_GLASS_ONION_DEMOS_BUCKET_ID }}
run: |
aws s3 sync ./demos s3://$AWS_S3_BUCKET_ID --delete