Update README with Antora-specific notes #26
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: CI | |
on: | |
push: | |
branches: | |
- master | |
- hls/antora # Temporary | |
env: | |
UPLOAD_BUCKET: s3://pedestal.io-upload | |
DEPLOY_BUCKET: s3://pedestal.io | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Set AWS credentials | |
uses: aws-actions/configure-aws-credentials@v1 | |
with: | |
aws-access-key-id: ${{ secrets.DOCS_AWS_ACCESS_KEY_ID }} | |
aws-secret-access-key: ${{ secrets.DOCS_AWS_ACCESS_KEY }} | |
aws-region: us-east-1 | |
- name: Checkout | |
uses: actions/[email protected] | |
# TODO: Cache Dependencies | |
- name: Install Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '20' | |
- name: Install Antora | |
run: | | |
npm install --save-dev --save-exact # Uses package.json, package-lock.json | |
npx antora -v | |
- name: Run Antora | |
# --fetch forces a fetch even if the repo previously exists | |
run: npx antora --fetch antora-playbook.yml | |
- name: Upload to AWS | |
# Clear the upload bucket, then copy files to the it. | |
run: | | |
aws s3 rm ${{ env.UPLOAD_BUCKET }} --recursive | |
aws s3 cp api ${{ env.UPLOAD_BUCKET }}/api --recursive | |
aws s3 cp build/site ${{ env.UPLOAD_BUCKET }} --recursive | |
aws s3 cp script/robots.txt ${{ env.UPLOAD_BUCKET }} | |
aws s3 ls ${{ env.UPLOAD_BUCKET }} # Temporary! | |
# Sync the temporary bucket to the real bucket (should be super fast). | |
# Goal here was to minimize disruption when rolling out changes. | |
# Temporarily copy to the /antora directory (until docs are ready to go) | |
- name: Sync upload to deployed | |
run: aws s3 sync ${{ env.UPLOAD_BUCKET }} ${{ env.DEPLOY_BUCKET }}/antora --delete |