Revenge/.github/workflows/build.yml
magmaus3 9ba87e2fec
Some checks failed
Build / Build and push (push) Failing after 37s
ci: modify for revenge builds
2024-02-10 13:00:57 +01:00

44 lines
1.4 KiB
YAML

name: Build
on:
push:
branches: [main]
jobs:
build:
name: Build and push
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v3
with:
repository: "revenge-mod/builds"
path: "builds"
# TODO: replace with gh equivelants before opening a PR
ssh-key: ${{ secrets.BUILDS_SSH_PRIVKEY }}
ssh-known-hosts: 'ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAILzaDn52MW7i6krceJeGIv20XkzVz+VRYS8FWyh+pXhf'
- uses: oven-sh/setup-bun@v1
- name: Install dependencies
run: |
bun i
- name: Build
run: bun run build
- name: Push builds
run: |
rm $GITHUB_WORKSPACE/builds/* || true
cp -r dist/* $GITHUB_WORKSPACE/builds || true
cd $GITHUB_WORKSPACE/builds
git config --local user.email "actions@github.com"
git config --local user.name "GitHub Actions"
git add .
git commit -m "Build $GITHUB_SHA" || exit 0
git push
### NOTE: temporarily commented out since we're not on github
# - name: Purge CDN cache
# run: |
# curl https://purge.jsdelivr.net/gh/vendetta-mod/builds