generated from amazon-archives/__template_Apache-2.0
-
Notifications
You must be signed in to change notification settings - Fork 2
102 lines (86 loc) · 2.7 KB
/
docs.yml
File metadata and controls
102 lines (86 loc) · 2.7 KB
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
name: publish Documentation to github pages
on:
push:
branches:
- main
env:
AWS_REGION: "us-west-2"
permissions:
contents: read
pages: write
id-token: write
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- name: Configure Pages
uses: actions/configure-pages@v5
- uses: actions/setup-python@v5
with:
python-version: 3.x
- name: Install dependencies
run: pip install zensical
- name: Build documentation
run: zensical build --clean
- name: Upload artifact for GitHub Pages (staging)
uses: actions/upload-pages-artifact@v4
with:
path: site
- name: Upload artifact for prod deploy
uses: actions/upload-artifact@v4
with:
name: docs-site
path: site
deploy-github-pages:
needs: build
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
permissions:
pages: write
id-token: write
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
deploy-prod:
needs: deploy-github-pages
runs-on: ubuntu-latest
environment: prod
permissions:
id-token: write
contents: read
env:
TARBALL: aws-durable-execution-docs-${{ github.sha }}.tar.gz
steps:
- name: Download built docs
uses: actions/download-artifact@v4
with:
name: docs-site
path: site
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@8df5847569e6427dd6c4fb1cf565c83acfa8afa7
with:
role-to-assume: ${{ secrets.SYNC_ROLE }}
role-session-name: docssyncsession
aws-region: ${{ env.AWS_REGION }}
- name: Create tarball of docs
run: tar -czf "${{ env.TARBALL }}" -C site .
- name: Upload tarball to S3
run: aws s3 cp "${{ env.TARBALL }}" "s3://${{ secrets.S3_BUCKET_NAME }}/${{ env.TARBALL }}"
- name: Invoke Lambda to sync to Gitfarm
run: |
aws lambda invoke \
--function-name "${{ secrets.SYNC_LAMBDA_ARN }}" \
--payload '{"gitFarmRepo":"${{ secrets.GF_REPO }}","s3FilePath":"${{ env.TARBALL }}","extractArchive":true,"gitHubRepo":"aws-durable-execution-docs","gitHubCommit":"${{ github.sha }}"}' \
--cli-binary-format raw-in-base64-out \
output.txt
- name: Check Lambda response for errors
run: |
if grep -q "Error" output.txt; then
cat output.txt
exit 1
fi
cat output.txt