Skip to content

Merge pull request #254 from phellen007/main #583

Merge pull request #254 from phellen007/main

Merge pull request #254 from phellen007/main #583

Workflow file for this run

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:
if: github.repository == 'FortuneStreetModding/fortunestreetmodding.github.io'
runs-on: ubuntu-latest
steps:
- name: Clone the repo
uses: actions/checkout@v4
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
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/*