37 lines
1.0 KiB
YAML
37 lines
1.0 KiB
YAML
name: Deploy to CF Multisite
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
|
|
jobs:
|
|
deploy:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Install AWS CLI
|
|
run: |
|
|
curl -sL "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o /tmp/awscliv2.zip
|
|
cd /tmp && unzip -q awscliv2.zip && sudo ./aws/install
|
|
aws --version
|
|
|
|
- name: Deploy to R2
|
|
env:
|
|
AWS_ACCESS_KEY_ID: ${{ secrets.R2_ACCESS_KEY }}
|
|
AWS_SECRET_ACCESS_KEY: ${{ secrets.R2_SECRET_KEY }}
|
|
R2_ENDPOINT: ${{ secrets.R2_ENDPOINT }}
|
|
run: |
|
|
SITE_ID="${{ github.event.repository.name }}"
|
|
|
|
aws s3 sync . "s3://multisite-bucket/sites/${SITE_ID}/" \
|
|
--endpoint-url "${R2_ENDPOINT}" \
|
|
--region auto \
|
|
--exclude ".git/*" \
|
|
--exclude ".gitea/*" \
|
|
--exclude "README.md" \
|
|
--delete
|
|
|
|
echo "Deployed to: https://${SITE_ID}.actions.it.com"
|