|
10 | 10 | types: |
11 | 11 | - published |
12 | 12 |
|
13 | | -env: |
14 | | - AWS_REGION: us-east-2 |
15 | | - IAM_ROLE_ARN: arn:aws:iam::557075604627:role/cplive-plat-ue2-prod-cloudposse-docs-gha |
16 | | - IAM_ROLE_SESSION_NAME: cloudposse-docs-ci-deploy-release |
17 | | - S3_BUCKET_NAME: cplive-plat-ue2-prod-cloudposse-docs-origin |
18 | | - DEPLOYMENT_HOST: docs.cloudposse.com |
19 | | - ALGOLIA_INDEX_NAME: docs.cloudposse.com |
20 | | - ALGOLIA_APP_ID: 32YOERUX83 |
21 | | - |
22 | | -# These permissions are needed to interact with the GitHub's OIDC Token endpoint |
23 | | -permissions: |
24 | | - id-token: write |
25 | | - contents: read |
26 | | - |
27 | 13 | jobs: |
28 | | - website-deploy-release: |
| 14 | + trigger_documentation_deployment: |
29 | 15 | runs-on: ubuntu-latest |
30 | 16 |
|
31 | 17 | environment: |
32 | 18 | name: production |
33 | | - url: https://${{ env.DEPLOYMENT_HOST }} |
| 19 | + url: https://docs.cloudposse.com |
34 | 20 |
|
35 | 21 | steps: |
36 | | - # https://github.com/marketplace/actions/configure-aws-credentials-action-for-github-actions |
37 | | - - name: Configure AWS Credentials |
38 | | - uses: aws-actions/configure-aws-credentials@v1 |
39 | | - with: |
40 | | - aws-region: ${{ env.AWS_REGION }} |
41 | | - role-to-assume: ${{ env.IAM_ROLE_ARN }} |
42 | | - role-session-name: ${{ env.IAM_ROLE_SESSION_NAME }} |
43 | | - |
44 | | - - name: Checkout Repository |
45 | | - uses: actions/checkout@v3 |
46 | | - with: |
47 | | - fetch-depth: 0 |
48 | | - |
49 | | - - name: "Checkout 'terraform-aws-components' Repository" |
50 | | - uses: actions/checkout@v3 |
51 | | - with: |
52 | | - fetch-depth: 1 |
53 | | - repository: cloudposse/terraform-aws-components |
54 | | - ref: master |
55 | | - path: tmp/components/terraform-aws-components |
56 | | - |
57 | | - - name: "Setup Python" |
58 | | - uses: actions/setup-python@v4 |
59 | | - with: |
60 | | - python-version: '3.10' |
61 | | - |
62 | | - - name: "Install deps" |
63 | | - run: | |
64 | | - make init |
65 | | - pip install -r scripts/docs-collator/requirements.txt |
66 | | -
|
67 | | - - name: "Render Documentation for Terraform Components" |
68 | | - run: | |
69 | | - ./scripts/render-docs-for-components.sh |
70 | | -
|
71 | | - - name: "Render Documentation for Terraform Modules" |
72 | | - env: |
73 | | - PUBLIC_REPO_ACCESS_TOKEN: ${{ secrets.PUBLIC_REPO_ACCESS_TOKEN }} |
74 | | - run: | |
75 | | - ./scripts/render-docs-for-modules.sh |
76 | | -
|
77 | | - - name: "Render Documentation for GitHub Actions" |
78 | | - env: |
79 | | - PUBLIC_REPO_ACCESS_TOKEN: ${{ secrets.PUBLIC_REPO_ACCESS_TOKEN }} |
80 | | - run: | |
81 | | - ./scripts/render-docs-for-github-actions.sh |
82 | | -
|
83 | | - - name: Install Dependencies and Build Website |
84 | | - env: |
85 | | - GOOGLE_TAG_MANAGER: ${{ vars.GOOGLE_TAG_MANAGER }} |
86 | | - run: | |
87 | | - make deps-production |
88 | | - make build |
89 | | -
|
90 | | - - name: Copy Website to S3 Bucket |
91 | | - run: | |
92 | | - cd build |
93 | | - aws sts get-caller-identity |
94 | | - aws s3 sync . s3://${{ env.S3_BUCKET_NAME }} --delete |
95 | | - aws s3 ls s3://${{ env.S3_BUCKET_NAME }} --recursive --human-readable --summarize |
96 | | -
|
97 | | - - name: ReIndex with Algolia |
98 | | - env: |
99 | | - ALGOLIA_SCRAPER_API_KEY: ${{ secrets.ALGOLIA_SCRAPER_API_KEY }} |
| 22 | + - name: Trigger Documentation Deployment |
100 | 23 | run: | |
101 | | - ./algolia/reindex.sh |
| 24 | + curl \ |
| 25 | + -X POST \ |
| 26 | + -H "Authorization: Bearer ${{ secrets.TRIGGER_DOCS_REDEPLOY_WORKFLOW_REFARCH }}" \ |
| 27 | + -H "Accept: application/vnd.github.everest-preview+json" \ |
| 28 | + https://api.github.com/repos/cloudposse/refarch-scaffold/dispatches \ |
| 29 | + -d '{"event_type": "redeploy_documentation"}' |
0 commit comments