2022-10-18 23:03:27 +00:00
|
|
|
name: Build
|
2023-03-10 23:38:50 +00:00
|
|
|
on:
|
|
|
|
push:
|
2024-02-10 11:37:41 +00:00
|
|
|
branches: [main]
|
2022-10-18 23:03:27 +00:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
name: Build and push
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v3
|
|
|
|
- uses: actions/checkout@v3
|
|
|
|
with:
|
2024-02-10 11:37:41 +00:00
|
|
|
repository: "ssh://git.magmaus3.eu.org:222/revenge-mod/builds"
|
2022-10-18 23:03:27 +00:00
|
|
|
path: "builds"
|
2024-02-10 11:37:41 +00:00
|
|
|
# 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
|
2022-10-18 23:03:27 +00:00
|
|
|
|
|
|
|
- name: Install dependencies
|
|
|
|
run: |
|
2024-02-10 11:37:41 +00:00
|
|
|
bun i
|
2022-10-18 23:03:27 +00:00
|
|
|
|
|
|
|
- name: Build
|
2024-02-10 11:37:41 +00:00
|
|
|
run: bun run build
|
2022-10-18 23:03:27 +00:00
|
|
|
|
|
|
|
- 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
|
2023-08-13 12:47:38 +00:00
|
|
|
git push
|
|
|
|
|
2024-02-10 11:37:41 +00:00
|
|
|
### NOTE: temporarily commented out since we're not on github
|
|
|
|
# - name: Purge CDN cache
|
|
|
|
# run: |
|
|
|
|
# curl https://purge.jsdelivr.net/gh/vendetta-mod/builds
|
2023-08-13 12:47:38 +00:00
|
|
|
|