-
Notifications
You must be signed in to change notification settings - Fork 173
37 lines (36 loc) · 1.17 KB
/
deploy.yml
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
name: Deploy To GitHub Pages
on:
schedule:
- cron: '0 22 * * *'
pull_request:
push:
branches:
- master
jobs:
ci:
name: CI
runs-on: ubuntu-latest
permissions:
id-token: write
contents: write
steps:
- uses: actions/checkout@v3
- name: Install mdbook
run: curl -sSL https://github.com/rust-lang/mdBook/releases/download/v0.4.35/mdbook-v0.4.35-x86_64-unknown-linux-gnu.tar.gz | tar -xz
- name: Build book
run: ./mdbook build
- name: Deploy book
uses: rust-lang/simpleinfra/github-actions/static-websites@master
with:
deploy_dir: book
github_token: "${{ secrets.GITHUB_TOKEN }}"
if: github.ref == 'refs/heads/master'
- name: Configure AWS credentials
if: github.ref == 'refs/heads/master'
uses: aws-actions/configure-aws-credentials@v1
with:
role-to-assume: arn:aws:iam::890664054962:role/forge-rust-lang-org-ci
aws-region: us-east-1
- name: Invalidate CloudFront cache
run: aws cloudfront create-invalidation --distribution-id E12A3GKHZSREHP --paths "/*"
if: github.ref == 'refs/heads/master'