name: Deploy on: push: branches: - main schedule: - cron: "0 0 * * *" workflow_dispatch: permissions: contents: write id-token: write concurrency: group: assets cancel-in-progress: false jobs: deploy: runs-on: ubuntu-latest steps: - name: Checkout repository uses: actions/checkout@v6 with: fetch-depth: 1 - name: Set up SSH signing key run: | mkdir -p ~/.ssh echo "${{ secrets.SSH_SIGNING_KEY }}" > ~/.ssh/id_ed25519 chmod 600 ~/.ssh/id_ed25519 git config --global gpg.format ssh git config --global user.signingKey ~/.ssh/id_ed25519 git config --global user.name "Lemuel DLS" git config --global user.email "noreply@git.lemueldls.dev" - uses: cachix/install-nix-action@v31 with: github_access_token: ${{ secrets.GITHUB_TOKEN }} - uses: cachix/cachix-action@v16 with: name: lemueldls authToken: ${{ secrets.CACHIX_AUTH_TOKEN }} - name: Update flake run: nix flake update - name: Add and commit changes run: | git add -A git commit -S -m "chore: update flake" || echo "No changes to commit" git push - name: Build flake run: | nix flake archive --json | jq -r '.path,(.inputs|to_entries[].value.path)' nix build --print-out-paths - name: Copy assets run: | mkdir -p public cp -r result/share/fonts public cp -r result/share/wallpapers/assets/contents/images public/wallpapers - name: Generate index run: | cd public find -L * -type f | jq -R . | jq -s . > index.json - name: Upload to R2 uses: zhaijunxiao/r2-dir-sync@v1.0.1 with: accountid: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} accesskeyid: ${{ secrets.CLOUDFLARE_ACCESS_KEY }} secretaccesskey: ${{ secrets.CLOUDFLARE_SECRET_KEY }} bucket: assets source: public