Skip to content

Commit 49df743

Browse files
committed
ci(publish-docs): Pin versions, port updates
1 parent 7de49ba commit 49df743

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

.github/workflows/publish-docs.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,18 +105,24 @@ jobs:
105105

106106
- name: Generate list of changed files for CloudFront to invalidate
107107
run: |
108-
pushd docs/_build/html; FILES=$(find . -name \* -print | grep html | cut -c2- | sort | uniq | tr '\n' ' '); popd
108+
FILES=$(find docs/_build/html -exec realpath --relative-to docs/_build/html {} \; | awk '{print "/"$0}' | grep "html\|searchindex.js\|custom.css\|.svg");
109109
for file in $FILES; do
110110
echo $file
111111
# add bare directory to list of updated paths when we see index.html
112112
[[ "$file" == *"/index.html" ]] && echo $file | sed -e 's/\/index.html$/\//'
113113
done | sort | uniq | tr '\n' ' ' > .updated_files
114114
115115
- name: Invalidate on CloudFront
116-
uses: chetan/invalidate-cloudfront-action@master
116+
uses: chetan/invalidate-cloudfront-action@v2.3
117117
env:
118118
DISTRIBUTION: ${{ secrets.AWS_CLOUDFRONT_DISTRIBUTION }}
119119
AWS_REGION: "us-east-1"
120120
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
121121
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
122122
PATHS_FROM: .updated_files
123+
124+
- name: Purge cache on Cloudflare
125+
uses: jakejarvis/cloudflare-purge-action@v0.3.0
126+
env:
127+
CLOUDFLARE_TOKEN: ${{ secrets.CLOUDFLARE_TOKEN }}
128+
CLOUDFLARE_ZONE: ${{ secrets.CLOUDFLARE_ZONE }}

0 commit comments

Comments
 (0)