-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Initial commit with only README and static files
- Loading branch information
0 parents
commit 71f4878
Showing
1,526 changed files
with
349,175 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
- name: Setup Tailscale | ||
uses: tailscale/github-action@main | ||
with: | ||
authkey: ${{ secrets.TAILSCALE_AUTHKEY }} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
on: [push] | ||
|
||
jobs: | ||
deploy: | ||
runs-on: ubuntu-latest | ||
name: Deploy blog to hydrogen | ||
if: github.ref == 'refs/heads/main' | ||
env: | ||
MACHINE: hydrogen | ||
steps: | ||
- name: Setup Go 1.17 | ||
id: go | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: "^1.17" | ||
- name: Setup Tailscale | ||
id: tailscale | ||
uses: tailscale/github-action@main | ||
with: | ||
authkey: ${{ secrets.TAILSCALE_AUTHKEY }} | ||
version: 1.7.359 | ||
- name: Add SSH key | ||
id: ssh | ||
env: | ||
SSH_KEY: ${{ secrets.SSH_KEY }} | ||
run: | | ||
mkdir -p ~/.ssh | ||
MACHINE_IP="$(tailscale ip -6 $MACHINE)" | ||
ssh-keyscan $MACHINE_IP >> ~/.ssh/known_hosts | ||
printf "%s" "$SSH_KEY" > ~/.ssh/key | ||
chmod 600 ~/.ssh/key | ||
- name: Fetch code | ||
id: fetch | ||
uses: actions/checkout@v1 | ||
|
||
- name: Compile blog binary | ||
id: compile | ||
run: go build -o prose . | ||
|
||
- name: Build tarball and ship it | ||
id: tarball | ||
run: | | ||
TIME=$(date +%Y%m%d-%H%M%S) | ||
FILENAME=prose-${TIME}.tar.gz | ||
mkdir -p static/css | ||
tar -czf $FILENAME prose static/ styles/ templates/ posts/ | ||
MACHINE_IP="$(tailscale ip -6 $MACHINE)" | ||
echo $FILENAME "github@[$MACHINE_IP]:/home/github/" | ||
scp -i ~/.ssh/key $FILENAME "github@[$MACHINE_IP]:/home/github/" | ||
ssh -i ~/.ssh/key "github@$MACHINE_IP" "tar -C /var/www/blog -xzf ~/$FILENAME" | ||
ssh -i ~/.ssh/key "github@$MACHINE_IP" "sudo systemctl restart prose" |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
on: [push, pull_request] | ||
name: Test | ||
jobs: | ||
build: | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest] | ||
|
||
target: [ | ||
aarch64-linux-gnu, | ||
aarch64-linux-musl, | ||
x86_64-linux-gnu, | ||
x86_64-linux-musl, | ||
aarch64-macos, | ||
x86_64-macos, | ||
wasm32-wasi | ||
|
||
# Broken but not in any obvious way: | ||
# x86-linux-gnu, | ||
# x86-linux-musl, | ||
|
||
# Not yet supported: | ||
# i386-windows, | ||
# x86_64-windows-gnu, | ||
] | ||
runs-on: ${{ matrix.os }} | ||
needs: test | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
with: | ||
submodules: recursive | ||
fetch-depth: 0 | ||
|
||
# Install Nix and use that to run our tests so our environment matches exactly. | ||
- uses: cachix/install-nix-action@v20 | ||
with: | ||
nix_path: nixpkgs=channel:nixos-unstable | ||
|
||
# Run our checks to catch quick issues | ||
- run: nix flake check | ||
|
||
# Run our go tests within the context of the dev shell from the flake. This | ||
# will ensure we have all our dependencies. | ||
- name: test | ||
run: nix develop -c zig build -fsummary -Dtarget=${{ matrix.target }} | ||
|
||
test: | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest] | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
with: | ||
submodules: recursive | ||
fetch-depth: 0 | ||
|
||
# Install Nix and use that to run our tests so our environment matches exactly. | ||
- uses: cachix/install-nix-action@v20 | ||
with: | ||
nix_path: nixpkgs=channel:nixos-unstable | ||
|
||
# Run our checks to catch quick issues | ||
- run: nix flake check | ||
|
||
# Run our go tests within the context of the dev shell from the flake. This | ||
# will ensure we have all our dependencies. | ||
- name: test | ||
run: nix develop -c zig build test -fsummary | ||
- name: test wasi | ||
run: nix develop -c zig build test -Dtarget=wasm32-wasi -fwasmtime -fsummary | ||
|
||
- name: build all benchmarks and examples | ||
run: nix develop -c zig build -Dexample -Dbench -fsummary | ||
|
||
# Run a full build to ensure that works | ||
- run: nix build |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
name: Nix Flake actions | ||
|
||
on: | ||
pull_request: | ||
push: | ||
branches: | ||
- master | ||
- main | ||
|
||
jobs: | ||
nix-matrix: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
matrix: ${{ steps.set-matrix.outputs.matrix }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: cachix/install-nix-action@v24 | ||
- id: set-matrix | ||
name: Generate Nix Matrix | ||
run: | | ||
set -Eeu | ||
matrix="$(nix eval --json '.#githubActions.matrix')" | ||
echo "matrix=$matrix" >> "$GITHUB_OUTPUT" | ||
nix-build: | ||
needs: nix-matrix | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: ${{fromJSON(needs.nix-matrix.outputs.matrix)}} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: cachix/install-nix-action@v24 | ||
- run: nix build -L ".#${{ matrix.attr }}" |
Oops, something went wrong.