Deploy config #58
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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' |