-
Notifications
You must be signed in to change notification settings - Fork 0
54 lines (50 loc) · 1.51 KB
/
convert.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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
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'