Skip to content

Optimized images

Optimized images #8

Workflow file for this run

name: Convert Vintage Guides
on:
# Allow running it manually against any ref
workflow_dispatch: {}
# Run on all push events
push: {}
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18
cache: npm
- name: Install NPM Dependencies
run: npm ci
- name: Convert Guides
run: npm run convert
- name: Compress artifact
run: tar cfz out.tar.gz out
- uses: actions/upload-artifact@v3
with:
name: guides
path: out.tar.gz
# This job publishes the release version of guides to S3
publish-web-release:
needs: build
name: Publish to Web
runs-on: ubuntu-latest
environment: Production
steps:
- uses: actions/download-artifact@v3
with:
name: guides
- name: Extract artifact
run: tar xf out.tar.gz
- name: Synchronize Versions
run: |
for version in minecraft-*; do
echo "Synchronizing $version"
aws s3 sync $version s3://$AWS_S3_BUCKET/$version --acl public-read --follow-symlinks --delete
done
working-directory: out
env:
AWS_S3_BUCKET: 'guide-assets'
AWS_ACCESS_KEY_ID: ${{ secrets.R2_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.R2_SECRET_ACCESS_KEY }}
AWS_REGION: auto
AWS_ENDPOINT_URL_S3: 'https://02aa146d8ef70ae7f9548b98cbb63161.r2.cloudflarestorage.com'