-
-
Notifications
You must be signed in to change notification settings - Fork 250
27 lines (26 loc) · 1007 Bytes
/
deploy-config.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
name: Deploy config
on:
- create
- workflow_dispatch
jobs:
build:
name: Deploy config
if: github.repository == 'crystal-lang/crystal-book' && startsWith(github.ref_name, 'release/')
runs-on: ubuntu-latest
steps:
- name: Download source
uses: actions/checkout@v4
- name: Build versions files
run: |
scripts/docs-versions.sh origin
grep '' versions.json aws-config.json # Display the files
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: us-east-1
- name: Deploy versions.json
run: aws s3 cp versions.json 's3://crystal-book/reference/versions.json'
- name: Deploy website configuration
run: aws s3api put-bucket-website --bucket 'crystal-book' --website-configuration 'file://aws-config.json'