Skip to content

Commit

Permalink
Add deploy script
Browse files Browse the repository at this point in the history
  • Loading branch information
nickswalker committed Jan 11, 2025
1 parent 72f7d36 commit 1ea3d27
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 1 deletion.
48 changes: 48 additions & 0 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
on:
push:
branches:
- master

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: 📂 setup
uses: actions/checkout@v4
- uses: actions/setup-node@v4
- name: Build
run: npm run build
- name: Upload build artifact
uses: actions/upload-artifact@v4
with:
name: site
path: .

deploy:
runs-on: ubuntu-latest
needs: [ build ]
if: github.ref == 'refs/heads/master'
steps:
- name: Download build result
uses: actions/download-artifact@v4
with:
name: site
- name: Setup SSH Keys and known_hosts
env:
SSH_AUTH_SOCK: /tmp/ssh_agent.sock
run: |
mkdir -p ~/.ssh
ssh-keyscan github.com >> ~/.ssh/known_hosts
ssh-keyscan ssh.nickwalker.us >> ~/.ssh/known_hosts
ssh-agent -a $SSH_AUTH_SOCK > /dev/null
ssh-add - <<< "${{ secrets.SSH_PRIVATE_KEY }}"
- name: 🚀 deploy
env:
SSH_AUTH_SOCK: /tmp/ssh_agent.sock
run: "rsync -havz * [email protected]:/var/www/marblizer.nickwalker.us/"
- name: Purge Cloudflare cache
uses: jakejarvis/[email protected]
env:
CLOUDFLARE_ZONE: ${{ secrets.CLOUDFLARE_ZONE }}
CLOUDFLARE_TOKEN: ${{ secrets.CLOUDFLARE_TOKEN }}

2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
<script>
window.goatcounter = {
path: function (p) {
return "/marblizer" + p;
return ".marblizer/" + p;
},
}
// Only run stats on live site
Expand Down

0 comments on commit 1ea3d27

Please sign in to comment.