Some checks failed
Build and Deploy to Storj / build-and-deploy (push) Failing after 1h6m54s
54 lines
1.7 KiB
YAML
54 lines
1.7 KiB
YAML
name: Build and Deploy to Storj
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
build-and-deploy:
|
|
runs-on: nixos
|
|
env:
|
|
PATH: /run/current-system/sw/bin
|
|
NIX_BUILD_CORES: 4
|
|
NIX_MAX_JOBS: 1
|
|
steps:
|
|
- name: Clone repo
|
|
run: |
|
|
export WORKDIR=/tmp/brand-site-${{ github.run_id }}
|
|
git clone http://localhost:3000/sscoble/brand-site.git "$WORKDIR"
|
|
cd "$WORKDIR"
|
|
git checkout ${{ github.sha }}
|
|
echo "WORKDIR=$WORKDIR" >> $GITHUB_ENV
|
|
|
|
- name: Build website with Nix
|
|
run: nix build .#website --option sandbox false --no-write-lock-file --cores 4 --max-jobs 1
|
|
working-directory: ${{ env.WORKDIR }}
|
|
|
|
- name: Build speaker profile PDF
|
|
run: nix build .#speaker-profile --option sandbox false --no-write-lock-file --cores 4 --max-jobs 1
|
|
working-directory: ${{ env.WORKDIR }}
|
|
|
|
- name: Copy build artifacts
|
|
run: |
|
|
mkdir -p ./dist
|
|
cp -r ${{ env.WORKDIR }}/result/* ./dist/
|
|
mkdir -p ./public/downloads
|
|
cp ${{ env.WORKDIR }}/result-2/* ./public/downloads/ 2>/dev/null || true
|
|
|
|
- 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
|