chore: rework github actions

This commit is contained in:
Alexis Tyler
2021-03-27 11:41:56 -07:00
parent 81a2b1d823
commit d4f92d006c

View File

@@ -1,4 +1,4 @@
name: Production
name: CI - Main
on:
push:
@@ -67,31 +67,51 @@ jobs:
- name: Checkout repo
uses: actions/checkout@v1
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: Add SSH deploy key
uses: shimataro/ssh-key-action@v2
with:
key: ${{ secrets.UNRAID_BOT_SSH_KEY }}
known_hosts: ${{ secrets.KNOWN_HOSTS }}
- name: Install node v${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: Cache npm cache
uses: actions/cache@v2
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Installing node deps
run: npm install
- name: Run build
run: npm run build
# See https://github.com/apollographql/subscriptions-transport-ws/issues/433
- name: Patch subscriptions-transport-ws
run: npm run patch:subscriptions-transport-ws
- name: Compile to javascript
run: npm run build
- name: Clean node_modules
run: npm run clean && curl -sf https://gobinaries.com/tj/node-prune | sh && node-prune
- name: Build binary
run: npm run build-binary
- name: Pack release
run: npm pack
- uses: actions/upload-artifact@v2
with:
name: unraid-api
path: ${{ github.workspace }}/*.tgz
- name: Release to Github and s3
if: startsWith(github.ref, 'refs/tags/')
uses: unraid/release-action@master
env:
GITHUB_USER: "unraid"