Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(ci): fix rclone #4989

Merged
merged 4 commits into from
Dec 12, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 15 additions & 18 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,19 @@ jobs:
node-version: '18'
cache: 'npm'

- name: Setup rclone
if: github.base_ref == 'develop' || github.base_ref == 'master'
uses: AnimMouse/setup-rclone@v1
with:
rclone_config: |
[r2]
type = s3
provider = Cloudflare
access_key_id = ${{ secrets.RCLONE_CONFIG_R2_ACCESS_KEY_ID }}
secret_access_key = ${{ secrets.RCLONE_CONFIG_R2_SECRET_ACCESS_KEY }}
endpoint = ${{ secrets.RCLONE_CONFIG_R2_ENDPOINT }}
disable_base64: true

- name: Install Dependencies
run: npm ci

Expand Down Expand Up @@ -84,15 +97,7 @@ jobs:

- name: Upload Assets (develop - R2)
if: github.base_ref == 'develop'
uses: andreiio/rclone-action@v1
env:
RCLONE_CONFIG_R2_TYPE: s3
RCLONE_CONFIG_R2_PROVIDER: Cloudflare
RCLONE_CONFIG_R2_ACCESS_KEY_ID: ${{ secrets.RCLONE_CONFIG_R2_ACCESS_KEY_ID }}
RCLONE_CONFIG_R2_SECRET_ACCESS_KEY: ${{ secrets.RCLONE_CONFIG_R2_SECRET_ACCESS_KEY }}
RCLONE_CONFIG_R2_ENDPOINT: ${{ secrets.RCLONE_CONFIG_R2_ENDPOINT }}
with:
args: sync .next/static r2:matters-assets-next-develop/_next/static -P
run: rclone sync .next/static r2:matters-assets-next-develop/_next/static -P

- name: Deploy to EB (develop)
if: github.base_ref == 'develop'
Expand All @@ -111,15 +116,7 @@ jobs:

- name: Upload Assets (production - R2)
if: github.base_ref == 'master'
uses: andreiio/rclone-action@v1
env:
RCLONE_CONFIG_R2_TYPE: s3
RCLONE_CONFIG_R2_PROVIDER: Cloudflare
RCLONE_CONFIG_R2_ACCESS_KEY_ID: ${{ secrets.RCLONE_CONFIG_R2_ACCESS_KEY_ID }}
RCLONE_CONFIG_R2_SECRET_ACCESS_KEY: ${{ secrets.RCLONE_CONFIG_R2_SECRET_ACCESS_KEY }}
RCLONE_CONFIG_R2_ENDPOINT: ${{ secrets.RCLONE_CONFIG_R2_ENDPOINT }}
with:
args: sync .next/static r2:matters-assets-next/_next/static -P
run: rclone sync .next/static r2:matters-assets-next/_next/static -P

- name: Deploy to EB (production)
if: github.base_ref == 'master'
Expand Down
Loading