Repository navigation
126 lines (100 loc) · 3.88 KB
/
Copy pathdocs.yaml
File metadata and controls
126 lines (100 loc) · 3.88 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
name: docs
on:
push:
branches:
- master
workflow_dispatch:
jobs:
build:
if: ${{ !contains(github.event.head_commit.message, '[skip ci]') }}
permissions:
contents: read
runs-on: ubuntu-latest
outputs:
sha: ${{ steps.sha.outputs.sha }}
steps:
- uses: actions/checkout@v7.0.1
with:
persist-credentials: false
- name: Record the built commit
id: sha
run: echo "sha=$(git rev-parse HEAD)" >> "$GITHUB_OUTPUT"
- name: Use Node.js
uses: actions/setup-node@v7.1.0
with:
node-version: 26
check-latest: true
- name: Install pnpm and dependencies
uses: apify/actions/pnpm-install@v1.6.2
- name: Build docs
run: |
pnpm run update-docs
pnpm --filter apify-cli-website add @apify/docs-theme@latest
pnpm --filter apify-cli-website run build
env:
SMARTLOOK_PROJECT_KEY: ${{ secrets.SMARTLOOK_DOCS_PROJECT_KEY }}
APIFY_SIGNING_TOKEN: ${{ secrets.APIFY_SIGNING_TOKEN }}
SEGMENT_TOKEN: ${{ secrets.SEGMENT_TOKEN }}
- name: Upload the updated package.json and lockfile
uses: actions/upload-artifact@v7.0.2
with:
name: docs-theme-update
path: |
website/package.json
pnpm-lock.yaml
retention-days: 1
- name: Upload GitHub Pages artifact
uses: actions/upload-pages-artifact@v5.0.0
with:
path: ./website/build
# The service account token is only used in jobs that do not run the docs toolchain.
commit:
needs: build
permissions:
contents: read
runs-on: ubuntu-latest
environment:
name: npm
deployment: false
steps:
- uses: actions/checkout@v7.0.1
with:
fetch-depth: 0
persist-credentials: false
# Start from the commit the update was made on, so the pull below merges it with anything pushed since.
- name: Reset to the built commit
run: git reset --hard "$BUILT_SHA"
env:
BUILT_SHA: ${{ needs.build.outputs.sha }}
- name: Download the updated package.json and lockfile
uses: actions/download-artifact@v8.0.2
with:
name: docs-theme-update
- name: Commit the updated package(-lock).json
uses: apify/actions/signed-commit@v1.6.2
with:
message: "chore: Automatic theme updating workflow [skip ci]"
add: 'website/package.json pnpm-lock.yaml'
pull: '--rebase --autostash'
github-token: ${{ secrets.APIFY_SERVICE_ACCOUNT_GITHUB_TOKEN }}
deploy:
needs: build
environment:
name: github-pages
permissions:
pages: write
id-token: write
runs-on: ubuntu-latest
steps:
- name: Set up GitHub Pages
uses: actions/configure-pages@v6.0.0
- name: Deploy artifact to GitHub Pages
uses: actions/deploy-pages@v5.0.1
- name: Invalidate CloudFront cache
run: |
gh workflow run invalidate-cloudfront.yml \
--repo apify/apify-docs-private \
--field deployment=apify-docs
echo "✅ CloudFront cache invalidation workflow triggered successfully"
env:
GITHUB_TOKEN: ${{ secrets.APIFY_SERVICE_ACCOUNT_GITHUB_TOKEN }}