diff --git a/.forgejo/workflows/deploy-landing.yml b/.forgejo/workflows/deploy-landing.yml new file mode 100644 index 0000000..cf0078a --- /dev/null +++ b/.forgejo/workflows/deploy-landing.yml @@ -0,0 +1,40 @@ +name: Deploy Landing Page to Storj + +on: + push: + branches: [main] + paths: + - 'landing/**' + workflow_dispatch: + +jobs: + deploy: + runs-on: nixos + steps: + - name: Create working directory + run: | + rm -rf /tmp/speckl-deploy-${{ github.run_id }} + mkdir -p /tmp/speckl-deploy-${{ github.run_id }} + echo "WORKDIR=/tmp/speckl-deploy-${{ github.run_id }}" >> $GITHUB_ENV + + - name: Clone repo + run: | + git clone http://localhost:3000/sscoble/speckl.git "${{ env.WORKDIR }}" + cd "${{ env.WORKDIR }}" + git checkout ${{ github.sha }} + + - 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 "${{ env.WORKDIR }}/landing/" storj:speckl/ --progress