Repository navigation
161 lines (148 loc) · 6.16 KB
/
Copy pathpush.yml
File metadata and controls
161 lines (148 loc) · 6.16 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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
name: Build and deploy
on:
push:
branches:
- master
permissions:
id-token: write # This is required for requesting the JWT
contents: read # This is required for actions/checkout
concurrency:
group: registry-production-deploy
cancel-in-progress: false
jobs:
build:
name: Build
env:
GOPATH: ${{ github.workspace }}/go
runs-on: pulumi-service-ubuntu-24.04-16core
timeout-minutes: 90
environment: production
steps:
- name: Authenticate to Pulumi Cloud
id: pulumi-auth
uses: pulumi/auth-actions@273044cc19e63ea565285da8edd4e059126a0bdb # v2.1.2
with:
organization: pulumi
requested-token-type: urn:pulumi:token-type:access_token:organization
export-environment-variables: false
- name: Fetch secrets from ESC
id: esc-secrets
uses: pulumi/esc-action@eec71a90d9989af7ff14bd700b83fc72fae36119 # v4.0.0
with:
pulumi-access-token: ${{ steps.pulumi-auth.outputs.pulumi-access-token }}
environment: pulumi/github-secrets/pulumi-registry
export-environment-variables: false
- name: Check out branch
uses: actions/checkout@v7
with:
token: ${{ steps.esc-secrets.outputs.PULUMI_BOT_TOKEN }}
# A re-run of an older commit can take the pending concurrency slot, so deploy the tip.
ref: master
# Full history needed for registry-mirror-discover to find package versions
fetch-depth: 0
- name: Install Node
uses: actions/setup-node@v7
with:
node-version: "24.22.1"
cache: 'yarn'
cache-dependency-path: |
yarn.lock
infrastructure/yarn.lock
themes/default/yarn.lock
themes/default/theme/yarn.lock
themes/default/theme/stencil/yarn.lock
- name: Install Go
uses: actions/setup-go@v7
id: setup-go
with:
go-version-file: tools/resourcedocsgen/go.mod
cache-dependency-path: tools/resourcedocsgen/go.sum
- name: Install Hugo
uses: peaceiris/actions-hugo@v3
with:
hugo-version: "0.169.0"
extended: true
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v6
with:
role-to-assume: arn:aws:iam::388588623842:role/ContinuousDelivery
role-session-name: docs-deploy
role-duration-seconds: 7200
aws-region: us-west-2
- name: Install s5cmd for fast S3 uploads
run: |
S5CMD_VERSION="2.3.0"
S5CMD_SHA256="de0fdbfa3aceae55e069ba81a0fc17b2026567637603734a387b2fca06c299b4"
curl -fsSL -o /tmp/s5cmd.tar.gz "https://github.com/peak/s5cmd/releases/download/v${S5CMD_VERSION}/s5cmd_${S5CMD_VERSION}_Linux-64bit.tar.gz"
echo "${S5CMD_SHA256} /tmp/s5cmd.tar.gz" | sha256sum --check --strict
sudo tar -xz -C /usr/local/bin s5cmd < /tmp/s5cmd.tar.gz
- name: Install Pulumi CLI
uses: pulumi/actions@96c7761824268174e0d2a4e8c7d75671eebd24a7 # v7
- name: Configure git for private Go modules
run: git config --global url."https://${{ steps.esc-secrets.outputs.PULUMI_BOT_TOKEN }}:x-oauth-basic@github.com/pulumi/registry-mirror-tools".insteadOf "https://github.com/pulumi/registry-mirror-tools"
- name: Cache provider schemas and generated docs
uses: actions/cache@v6
with:
path: |
.cache/schemas
.cache/versioned-docs
.cache/api-docs
key: docs-cache-${{ github.run_id }}
restore-keys: docs-cache-
- name: Get registry-mirror-discover version
id: mirror-version
run: echo "hash=$(grep 'REGISTRY_MIRROR_TOOLS_COMMIT=' scripts/generate-versioned-docs.sh | cut -d'"' -f2)" >> "$GITHUB_OUTPUT"
- name: Cache registry-mirror-discover binary
uses: actions/cache@v6
with:
path: bin/registry-mirror-discover
key: registry-mirror-discover-${{ steps.mirror-version.outputs.hash }}-go${{ steps.setup-go.outputs.go-version }}
- name: Build and deploy
run: make ci_push
env:
PULUMI_ACCESS_TOKEN: ${{ steps.esc-secrets.outputs.PULUMI_ACCESS_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
ALGOLIA_APP_ID: ${{ vars.ALGOLIA_APP_ID }}
ALGOLIA_APP_SEARCH_KEY: ${{ vars.ALGOLIA_APP_SEARCH_KEY }}
ALGOLIA_APP_ADMIN_KEY: ${{ steps.esc-secrets.outputs.ALGOLIA_APP_ADMIN_KEY }}
PULUMI_STACK_NAME: ${{ vars.PULUMI_STACK_NAME }}
PULUMI_DOCS_STACK_NAME: ${{ vars.PULUMI_DOCS_STACK_NAME }}
DEPLOYMENT_ENVIRONMENT: ${{ vars.DEPLOYMENT_ENVIRONMENT }}
NODE_OPTIONS: "--max_old_space_size=8192"
- name: Archive bucket metadata
uses: actions/upload-artifact@v7
with:
name: origin-bucket-metadata
path: origin-bucket-metadata.json
notify:
if: failure()
name: Send slack notification
runs-on: ubuntu-latest
timeout-minutes: 5
needs: [build]
permissions:
id-token: write
steps:
- name: Authenticate to Pulumi Cloud
id: pulumi-auth
uses: pulumi/auth-actions@273044cc19e63ea565285da8edd4e059126a0bdb # v2.1.2
with:
organization: pulumi
requested-token-type: urn:pulumi:token-type:access_token:organization
export-environment-variables: false
- name: Fetch secrets from ESC
id: esc-secrets
uses: pulumi/esc-action@eec71a90d9989af7ff14bd700b83fc72fae36119 # v4.0.0
with:
pulumi-access-token: ${{ steps.pulumi-auth.outputs.pulumi-access-token }}
environment: pulumi/github-secrets/pulumi-registry
export-environment-variables: false
- name: Slack Notification
uses: docker://sholung/action-slack-notify:v2.3.0
env:
SLACK_CHANNEL: registry-ops
SLACK_COLOR: "#F54242"
SLACK_MESSAGE: "build and deploy failure in pulumi/registry repo :meow_sad:"
SLACK_USERNAME: registrybot
SLACK_WEBHOOK: ${{ steps.esc-secrets.outputs.SLACK_WEBHOOK_URL }}
SLACK_ICON: https://www.pulumi.com/logos/brand/avatar-on-white.png