🔀 Merge #901 (Bump @types/node from 22.13.0… #1166
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Continuous Integration | |
concurrency: ci | |
on: | |
push: | |
branches: [master] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
concurrency: discord_api | |
env: | |
DISCORD_BOT_TOKEN: "${{ secrets.DISCORD_BOT_TOKEN }}" | |
TEST_CHANNEL_ID: "${{ secrets.TEST_CHANNEL_ID }}" | |
SCRAPE_URL: http://localhost:8090 | |
FETCH_INTERVAL: 1000 | |
FETCH_INTERVAL_RANDOM: 0 | |
API_PORT: 3050 | |
outputs: | |
version: ${{ steps.output_version.outputs.version }} | |
steps: | |
- name: Create version | |
run: echo "VERSION=$(date -u +%Y%m%d_%H%M%S_%N)" >> $GITHUB_ENV | |
- name: Output version | |
id: output_version | |
run: echo "::set-output name=version::$VERSION" | |
- uses: actions/checkout@v4 | |
- name: Setup Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: "22.x" | |
- run: npm ci | |
- run: npm run build | |
- name: Create subs file for tests # Workaround for bot not receiving messages from test channel | |
uses: "DamianReeves/write-file-action@master" | |
with: | |
path: subs.txt | |
write-mode: overwrite | |
contents: | | |
${{ secrets.TEST_CHANNEL_ID }} | |
- run: npm start & npx wait-on -t 60000 http://localhost:${{ env.API_PORT }}/health | |
- run: npm test | |
- run: mkdir build | |
- name: Generate deployment package | |
run: cp -r dist node_modules package.json build | |
- name: Publish artifact | |
uses: actions/upload-artifact@master | |
with: | |
name: ${{ steps.output_version.outputs.version }} | |
path: build |