mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-29 05:29:52 +01:00
feat: updated host workflow
This commit is contained in:
1 parent
c685f86dc4
commit
391d5c532d
1 file changed
+15
-24
+15
-24
@@ -8,40 +8,31 @@ on:
|
|||||||
- 'main'
|
- 'main'
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
concurrency:
|
|
||||||
group: ${{ github.workflow }}-${{ github.ref }}
|
|
||||||
cancel-in-progress: true
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
host:
|
host:
|
||||||
name: Host
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
node-version: [18.x]
|
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Get code
|
|
||||||
uses: actions/checkout@v2
|
|
||||||
|
|
||||||
- name: Use node
|
- name: Use node
|
||||||
uses: actions/setup-node@v2
|
uses: actions/setup-node@v2
|
||||||
with:
|
with:
|
||||||
node-version: ${{ matrix.node-version }}
|
node-version: ${{ matrix.node-version }}
|
||||||
cache: 'npm'
|
|
||||||
|
|
||||||
- name: Install Yarn
|
- name: Get latest release
|
||||||
run: npm install --location=global yarn
|
uses: actions/github-script@v4
|
||||||
|
|
||||||
- name: Use node_modules cache
|
|
||||||
uses: actions/cache@v2
|
|
||||||
with:
|
with:
|
||||||
path: '**/node_modules'
|
script: |
|
||||||
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
|
const response = await github.repos.getLatestRelease({
|
||||||
|
owner: context.repo.owner,
|
||||||
|
repo: context.repo.repo
|
||||||
|
});
|
||||||
|
console.log(response.data.assets[0].browser_download_url);
|
||||||
|
core.setOutput("download_url", response.data.assets[0].browser_download_url);
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Download release assets
|
||||||
run: yarn
|
run: |
|
||||||
|
curl -L -o dist.zip ${{ steps.get-latest-release.outputs.download_url }}
|
||||||
|
unzip dist.zip
|
||||||
|
|
||||||
- name: Host
|
- name: Run index.cjs
|
||||||
run: NODE_ENV=production DISCORD_TOKEN=${{ secrets.DISCORD_TOKEN }} WARGAMING_APPLICATION_ID=${{ secrets.WARGAMING_APPLICATION_ID }} yarn dev
|
run: NODE_ENV=production DISCORD_TOKEN=${{ secrets.DISCORD_TOKEN }} WARGAMING_APPLICATION_ID=${{ secrets.WARGAMING_APPLICATION_ID }} node --enable-source-maps dist/index.cjs
|
||||||
Reference in new issue
Block a user