Skip to content

Commit

Permalink
Merge pull request #4989 from thematters/develop
Browse files Browse the repository at this point in the history
fix(ci): fix rclone
  • Loading branch information
gitwoz authored Dec 12, 2024
2 parents a57f2f7 + 16e17eb commit 3accd61
Showing 1 changed file with 15 additions and 18 deletions.
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

0 comments on commit 3accd61

Please sign in to comment.