-
Notifications
You must be signed in to change notification settings - Fork 42
67 lines (56 loc) · 2.08 KB
/
upload-to-s3.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
55
56
57
58
59
60
61
62
63
64
65
66
67
name: Upload Maps to S3
on:
push:
branches:
- main
workflow_dispatch:
permissions:
id-token: write
contents: read # This is required for actions/checkout
jobs:
UploadMapsToS3:
runs-on: ubuntu-latest
steps:
- name: Clone the repo
uses: actions/checkout@v3
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
role-to-assume: ${{ secrets.ASSUME_ROLE_ARN }}
role-session-name: ghamapuploadingrolesession
aws-region: ${{ secrets.AWS_REGION }}
- name: Zip maps
shell: bash
working-directory: ./_maps
run: |
for mapDir in *; do
cd ${mapDir}
zip -r ../${mapDir}.zip .
cd ..
done
- name: Upload maps to S3
run: aws s3 cp ./_maps s3://${{ secrets.S3_BUCKET_NAME }}/cswt/Maps --recursive --exclude "*" --include "*.zip"
- name: Create CloudFront invalidation for maps
run: aws cloudfront create-invalidation --distribution-id ${{ secrets.CLOUDFRONT_DISTRIBUTION_ID }} --paths /cswt/Maps/*
UploadPyCSMMToS3:
runs-on: ubuntu-latest
steps:
- name: Clone the repo
uses: actions/checkout@v3
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
role-to-assume: ${{ secrets.ASSUME_ROLE_ARN }}
role-session-name: ghamapuploadingrolesession
aws-region: ${{ secrets.AWS_REGION }}
- name: Copy over mapList.yaml and backgrounds.yml
run: |
cp _data/mapList.yaml _data/backgrounds.yml cswtpycsmm
- name: Zip modpack and map list files
run: |
zip -r cswtpycsmm-dev.zip cswtpycsmm
- name: Upload modpack to s3
run: aws s3 cp cswtpycsmm-dev.zip s3://${{ secrets.S3_BUCKET_NAME }}/cswt/Builds/
- name: Create CloudFront invalidation for modpack
run: |
aws cloudfront create-invalidation --distribution-id ${{ secrets.CLOUDFRONT_DISTRIBUTION_ID }} --paths /cswt/Builds/*