-
Notifications
You must be signed in to change notification settings - Fork 0
111 lines (105 loc) · 3.84 KB
/
Copy pathdeploy.yml
File metadata and controls
111 lines (105 loc) · 3.84 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
103
104
105
106
107
108
109
110
111
name: Deploy documentation site
on:
push:
branches:
- main
workflow_dispatch:
concurrency:
group: fsharp-viewengine-production
cancel-in-progress: false
jobs:
deploy:
name: Deploy documentation site
runs-on: ubuntu-latest
timeout-minutes: 15
environment:
name: production
url: https://fsharpviewengine.meiermade.com
permissions:
contents: read
id-token: write
outputs:
commit: ${{ steps.source.outputs.commit }}
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Resolve deployment source
id: source
run: echo "commit=$(git rev-parse HEAD)" >> "$GITHUB_OUTPUT"
- name: Setup Node
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
with:
node-version: 24
# Pulumi ESC supplies CLOUDSDK_AUTH_ACCESS_TOKEN to the Pulumi process.
# setup-gcloud cannot detect token overrides: https://github.com/google-github-actions/setup-gcloud/issues/731
- name: Install GKE auth plugin
uses: google-github-actions/setup-gcloud@aa5489c8933f4cc7a4f7d45035b3b1440c9c10db # v3.0.1
with:
install_components: gke-gcloud-auth-plugin
- name: Install Packages
run: npm ci
working-directory: ./pulumi
- name: Authenticate Pulumi
uses: pulumi/auth-actions@141415910c3beb54e03b48e9057c204c97b956f2 # v2.1.0
with:
organization: meiermade
requested-token-type: urn:pulumi:token-type:access_token:personal
scope: user:meiermade
- name: Deploy
uses: pulumi/actions@8e5e406f4007fca908480587cb9893c07090f58d # v7.0.0
env:
RELEASE_COMMIT: ${{ steps.source.outputs.commit }}
with:
work-dir: ./pulumi
command: up
stack-name: meiermade/fsharp-view-engine/prod
e2e:
name: Production smoke test
needs: deploy
runs-on: ubuntu-latest
timeout-minutes: 10
permissions:
contents: read
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
ref: ${{ needs.deploy.outputs.commit }}
- name: Setup Node
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
with:
node-version: 24
cache: npm
cache-dependency-path: e2e/package-lock.json
- name: Install E2E packages
run: npm ci
working-directory: ./e2e
- name: Wait for deployed documentation site
env:
EXPECTED_COMMIT: ${{ needs.deploy.outputs.commit }}
run: |
for _ in $(seq 1 60); do
health="$(curl --fail --silent --show-error https://fsharpviewengine.meiermade.com/health || true)"
status="$(jq -r '.status // empty' <<< "$health" 2>/dev/null || true)"
commit="$(jq -r '.commit // empty' <<< "$health" 2>/dev/null || true)"
if [[ "$status" == "ok" && "$commit" == "$EXPECTED_COMMIT" ]]; then
exit 0
fi
echo "Waiting for documentation site at $EXPECTED_COMMIT; found commit=${commit:-unknown}."
sleep 5
done
echo "The documentation site did not report the expected commit." >&2
exit 1
- name: Test deployed documentation site
run: bash scripts/test-published-ci.sh
working-directory: ./e2e
env:
DOCS_E2E_BASE_URL: https://fsharpviewengine.meiermade.com
DOCS_EXPECTED_COMMIT: ${{ needs.deploy.outputs.commit }}
- name: Upload E2E diagnostics
if: failure()
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: fsharp-viewengine-deploy-e2e
path: |
e2e/playwright-report
e2e/test-results
if-no-files-found: ignore