Some checks are pending
Build and Deploy to Storj / build-and-deploy (push) Waiting to run
46 lines
1.1 KiB
YAML
46 lines
1.1 KiB
YAML
name: Build and Deploy to Storj
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
build-and-deploy:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: '20'
|
|
cache: 'npm'
|
|
|
|
- name: Install dependencies
|
|
run: npm ci
|
|
|
|
- name: Build
|
|
run: npm run build
|
|
|
|
- name: Install rclone
|
|
run: |
|
|
curl https://rclone.org/install.sh | bash
|
|
|
|
- name: Configure rclone
|
|
run: |
|
|
mkdir -p ~/.config/rclone
|
|
cat > ~/.config/rclone/rclone.conf << 'EOF'
|
|
[storj]
|
|
type = s3
|
|
provider = Storj
|
|
access_key_id = ${{ secrets.STORJ_ACCESS_KEY }}
|
|
secret_access_key = ${{ secrets.STORJ_SECRET_KEY }}
|
|
endpoint = https://gateway.storjshare.io
|
|
EOF
|
|
|
|
- name: Deploy to Storj
|
|
run: |
|
|
rclone sync ./dist/ storj:${{ secrets.STORJ_BUCKET }}/ --progress
|
|
rclone sync ./public/downloads/ storj:${{ secrets.STORJ_BUCKET }}/downloads/ --progress
|