chore(main): release 2.2.0 (#108) #84
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 documentation | |
on: | |
workflow_dispatch: | |
push: | |
paths: | |
- "docs/**" | |
jobs: | |
build-and-upload: | |
runs-on: ubuntu-latest | |
timeout-minutes: 5 | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
- uses: actions/setup-node@v2 | |
with: | |
cache: "npm" | |
node-version-file: ".nvmrc" | |
- name: Prepare root and packages | |
run: | | |
npm ci | |
npm run build:core | |
- name: Install | |
working-directory: docs | |
run: npm ci | |
- name: Build | |
working-directory: docs | |
run: npm run build | |
- name: Configure AWS credentials | |
uses: aws-actions/configure-aws-credentials@v1 | |
with: | |
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
aws-region: eu-central-1 | |
- name: Set bucket name | |
run: | | |
BUCKET_NAME=cardsgame.darekgreenly.com | |
if [[ $GITHUB_REF != "refs/heads/main" ]]; then | |
BUCKET_NAME=dev-cardsgame.darekgreenly.com | |
fi | |
echo "BUCKET_NAME=$BUCKET_NAME" >> $GITHUB_ENV | |
- name: Upload all files | |
working-directory: docs | |
run: | | |
aws s3 sync build s3://${{ env.BUCKET_NAME }} --delete \ | |
--cache-control "public, max-age=31536000, immutable" | |
aws s3 cp build/index.html s3://${{ env.BUCKET_NAME }}/index.html \ | |
--cache-control "max-age=604800, no-cache" | |
aws s3 cp build/sitemap.xml s3://${{ env.BUCKET_NAME }}/sitemap.xml \ | |
--cache-control "max-age=604800, no-cache" |