-
Notifications
You must be signed in to change notification settings - Fork 23
51 lines (45 loc) · 1.58 KB
/
illustrations-upload.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
name: Upload Illustrations
on:
push:
branches:
- main
paths:
- packages/illustrations/**
env:
BUCKET_NAME: ultraviolet
BUCKET_REGION: fr-par
jobs:
## Synchronize assets on bucket
upload-illustrations-:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Python environment
uses: actions/setup-python@v5
with:
python-version: "3.10"
- uses: pnpm/action-setup@v4.0.0
- uses: actions/setup-node@v4.0.3
with:
node-version: 20
cache: "pnpm"
- run: pnpm install
- name: Install aws CLI
run: |
sudo python3 -m pip install --upgrade pip
sudo python3 -m pip install awscli==1.19.27 awscli_plugin_endpoint
pip3 install awscli_plugin_endpoint && pip3 show awscli_plugin_endpoint
- name: AWS CLI configuration
run: |
mkdir ~/.aws
cp ./.aws/* ~/.aws/
sed -i -e 's/${BUCKET_REGION}/${{env.BUCKET_REGION}}/g' ~/.aws/config
- name: Upload illustrations on bucket
run: |
aws s3 sync packages/illustrations/src/assets s3://${{ env.BUCKET_NAME }}/illustrations/ --exclude "*" --include "*.webp" --include "*.svg" --acl public-read --cache-control max-age=2592000,public
aws s3api put-bucket-cors --bucket ${{ env.BUCKET_NAME }} --cors-configuration file://.aws/cors.json
env:
AWS_ACCESS_KEY_ID: ${{ secrets.S3_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.S3_SECRET_KEY }}