chore: release (#4296) #29
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.4 | |
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 }} |