58 lines
No EOL
1.6 KiB
YAML
58 lines
No EOL
1.6 KiB
YAML
name: Build and Deploy to Storj
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
build-and-deploy:
|
|
runs-on: nixos
|
|
env:
|
|
NIX_BUILD_CORES: 4
|
|
NIX_MAX_JOBS: 1
|
|
steps:
|
|
- name: Create working directory
|
|
run: |
|
|
rm -rf /tmp/brand-site-${{ github.run_id }}
|
|
mkdir -p /tmp/brand-site-${{ github.run_id }}
|
|
echo "WORKDIR=/tmp/brand-site-${{ github.run_id }}" >> $GITHUB_ENV
|
|
|
|
- name: Clone repo
|
|
run: |
|
|
git clone http://localhost:3000/sscoble/brand-site.git "${{ env.WORKDIR }}"
|
|
cd "${{ env.WORKDIR }}"
|
|
git checkout ${{ github.sha }}
|
|
|
|
- name: Build website
|
|
run: |
|
|
cd "${{ env.WORKDIR }}"
|
|
npm ci
|
|
npm run build
|
|
|
|
- name: Build speaker profile PDF (optional)
|
|
continue-on-error: true
|
|
run: |
|
|
cd "${{ env.WORKDIR }}"
|
|
typst compile one-sheet.typ ./dist/downloads/Scott-Scoble-Human-Cultivation-Expert-Speaker-Profile.pdf
|
|
|
|
- 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 }}/dist/" storj:${{ secrets.STORJ_BUCKET }}/ --progress
|
|
|
|
- name: Cleanup
|
|
if: always()
|
|
run: |
|
|
rm -rf "${{ env.WORKDIR }}" |