Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build and Deploy
name: Deploy
permissions: {}

on:
Expand Down Expand Up @@ -45,13 +45,6 @@ jobs:
npm ci
echo "✅ Dependencies installed successfully"

# for now we run without building
# - name: Build the application
# working-directory: /home/vb2007/prod/discordbot
# run: |
# npm run build
# echo "Application built successfully"

- name: Deploying possible new commands
working-directory: /home/vb2007/prod/discordbot
env:
Expand Down
46 changes: 46 additions & 0 deletions .github/workflows/gh-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Release on GitHub

permissions:
contents: write

on:
push:
branches: [main]

jobs:
release:
#requires gh cli on the runner: https://github.com/cli/cli/blob/trunk/docs/install_linux.md
runs-on: self-hosted

steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0 #fetch full history for changelog generation

- name: Get version from package.json
id: package-version
run: |
VERSION=$(node -p "require('./package.json').version")
echo "version=v$VERSION" >> $GITHUB_OUTPUT
echo "raw_version=$VERSION" >> $GITHUB_OUTPUT

- name: Check if tag already exists
id: tag-check
run: |
if git tag -l "${{ steps.package-version.outputs.version }}" | grep -q "${{ steps.package-version.outputs.version }}"; then
echo "exists=true" >> $GITHUB_OUTPUT
else
echo "exists=false" >> $GITHUB_OUTPUT
fi

- name: Create GitHub Release
if: steps.tag-check.outputs.exists == 'false'
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
run: |
gh release create "${{ steps.package-version.outputs.version }}" \
--title "${{ steps.package-version.outputs.version }}" \
--generate-notes \
--latest \
./src/data/commandData.csv
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "discordbot",
"version": "4.0.1",
"version": "4.1.1",
"description": "A simple discord bot of mine developed with discord.js (Node.js).",
"type": "module",
"main": "index.js",
Expand Down