Some checks failed
Build and Deploy to Storj / build-and-deploy (push) Failing after 3s
46 lines
1.2 KiB
YAML
46 lines
1.2 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: Install Nix
|
|
uses: cachix/install-nix-action@v25
|
|
with:
|
|
nix_path: nixpkgs=channel:nixos-unstable
|
|
extra_nix_config: |
|
|
experimental-features = nix-command flakes
|
|
|
|
- name: Build with Nix
|
|
run: |
|
|
nix-shell -p nodejs_20 git rclone --run "
|
|
npm ci
|
|
npm run build
|
|
"
|
|
|
|
- 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: |
|
|
nix-shell -p rclone --run "
|
|
rclone sync ./dist/ storj:${{ secrets.STORJ_BUCKET }}/ --progress
|
|
rclone sync ./public/downloads/ storj:${{ secrets.STORJ_BUCKET }}/downloads/ --progress
|
|
"
|