fix: safari favicon #896
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Deploy Site | |
on: | |
push: | |
branches: | |
- main | |
paths: | |
- 'site/**' | |
pull_request: | |
paths: | |
- 'site/**' | |
workflow_dispatch: | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }} | |
cancel-in-progress: true | |
env: | |
NIX_VERSION: nix-2.13.2 | |
NIXPKGS_CHANNEL: nixos-22.11 | |
NODE_OPTIONS: '--no-warnings' | |
ACTIONS_RUNNER_DEBUG: true | |
ASTRO_TELEMETRY_DISABLED: true | |
jobs: | |
build: | |
runs-on: ['ubuntu-latest'] | |
permissions: | |
contents: read | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
lfs: true | |
- uses: nixbuild/nix-quick-install-action@v26 | |
with: | |
nix_on_tmpfs: false | |
nix_conf: | | |
experimental-features = nix-command flakes | |
access-tokens = ${{ secrets.GITHUB_TOKEN }} | |
- uses: nixbuild/nixbuild-action@812f1ab2b51842b0d44b9b79574611502d6940a0 | |
with: | |
nixbuild_token: ${{secrets.nixbuild_token}} | |
- name: Build site | |
run: | | |
touch build.json | |
nix build .#packages.x86_64-linux.site \ | |
--print-build-logs \ | |
--eval-store auto \ | |
--store ssh-ng://eu.nixbuild.net \ | |
--builders "" --max-jobs 2 \ | |
--show-trace \ | |
--json | |
deploy-preview: | |
runs-on: ['ubuntu-latest'] | |
needs: [build] | |
permissions: | |
contents: read | |
pull-requests: write | |
env: | |
npm_config_yes: true | |
environment: 'site-preview' | |
# manually disable this for now since we use Netlify for site previews | |
if: false | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
lfs: true | |
- uses: nixbuild/nix-quick-install-action@v26 | |
- uses: nixbuild/nixbuild-action@812f1ab2b51842b0d44b9b79574611502d6940a0 | |
with: | |
nixbuild_token: ${{ secrets.nixbuild_token }} | |
- run: mkdir dump | |
- run: nix copy --to file://`pwd`/dump --from ssh-ng://eu.nixbuild.net `nix eval --raw .#packages.x86_64-linux.site` --extra-experimental-features nix-command | |
- run: cat dump/nar/*.nar.xz | xz -dc | nix-store --restore result | |
- name: '[preview] 🔶 Publish to Cloudflare Pages' | |
env: | |
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} | |
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_WORKERS_API_TOKEN }} | |
run: npx --yes wrangler@latest pages --project-name="site" deploy result >> /tmp/site_deploy.txt | |
- name: Remove Lychee Cache | |
run: rm -rf .lycheecache | |
- name: Link Check | |
id: lychee | |
uses: lycheeverse/[email protected] | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
args: | | |
'result/**/index.html' --no-progress | |
- name: Comment Link Checker Results | |
if: env.lychee_exit_code != 0 | |
uses: thollander/actions-comment-pull-request@v2 | |
with: | |
filePath: ./lychee/out.md | |
comment_tag: link-checker | |
- name: Set Deploy Output | |
run: | | |
{ | |
echo 'DEPLOY_OUTPUT<<EOF' | |
tail -n 2 /tmp/site_deploy.txt | |
echo 'EOF' | |
} >> $GITHUB_ENV | |
- name: Comment Site Deploy Results | |
uses: thollander/actions-comment-pull-request@v2 | |
with: | |
message: | | |
# Site/Docs 🤠 | |
${{ env.DEPLOY_OUTPUT }} | |
**${{ env.LAST_UPDATED_AT }}** | |
comment_tag: deploy-preview-result | |
deploy-manual: | |
runs-on: ['ubuntu-latest'] | |
needs: [build] | |
env: | |
npm_config_yes: true | |
if: github.event_name == 'workflow_dispatch' | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
lfs: true | |
- uses: nixbuild/nix-quick-install-action@v26 | |
- uses: nixbuild/nixbuild-action@812f1ab2b51842b0d44b9b79574611502d6940a0 | |
with: | |
nixbuild_token: ${{ secrets.nixbuild_token }} | |
- run: mkdir dump | |
- run: nix copy --to file://`pwd`/dump --from ssh-ng://eu.nixbuild.net `nix eval --raw .#packages.x86_64-linux.site` --extra-experimental-features nix-command | |
- run: cat dump/nar/*.nar.xz | xz -dc | nix-store --restore result | |
# create preview deployment when trigger is workflow_dispatch && branch is not main | |
- name: '[workflow-dispatch] 🔶 Publish to Cloudflare Pages' | |
env: | |
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} | |
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_WORKERS_API_TOKEN }} | |
run: npx --yes wrangler@latest pages --project-name="site" deploy result | |
deploy-production: | |
runs-on: ['ubuntu-latest'] | |
needs: [build] | |
env: | |
npm_config_yes: true | |
environment: 'site-production' | |
# if: github.event_name == 'push' && github.ref == 'refs/heads/main' | |
# manually disable this for now since we use Netlify | |
if: false | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
lfs: true | |
- uses: nixbuild/nix-quick-install-action@v26 | |
- uses: nixbuild/nixbuild-action@812f1ab2b51842b0d44b9b79574611502d6940a0 | |
with: | |
nixbuild_token: ${{ secrets.nixbuild_token }} | |
- run: mkdir dump | |
- run: nix copy --to file://`pwd`/dump --from ssh-ng://eu.nixbuild.net `nix eval --raw .#packages.x86_64-linux.site` --extra-experimental-features nix-command | |
- run: cat dump/nar/*.nar.xz | xz -dc | nix-store --restore result | |
- name: '[production] 🔶 Publish to Cloudflare Pages' | |
env: | |
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} | |
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_WORKERS_API_TOKEN }} | |
run: npx --yes wrangler@latest pages --project-name="site" --branch="main" deploy result |