-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
53 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
node_modules | ||
npm-debug.log | ||
Dockerfile | ||
.dockerignore |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
name: CI | ||
|
||
on: | ||
push: | ||
branches: ['master'] | ||
|
||
jobs: | ||
deploy: | ||
name: Deploy to VPS | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
|
||
- name: executing remote ssh commands using password | ||
uses: appleboy/ssh-action@v0.1.10 | ||
with: | ||
host: ${{ secrets.SSH_IP }} | ||
username: ${{ secrets.SSH_USERNAME }} | ||
password: ${{ secrets.SSH_PASSWORD }} | ||
port: ${{ secrets.SSH_PORT }} | ||
script: | | ||
cd unisafka-discord | ||
rm -rf unisafka-discord | ||
git clone https://github.com/KasperiP/unisafka-discord.git | ||
cp .env unisafka-discord/.env | ||
cd unisafka-discord | ||
docker stop unisafka-discord | ||
docker rm unisafka-discord | ||
docker build -t unisafka-discord . | ||
docker run -d --restart=always --name unisafka-discord unisafka-discord |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# Use the official Node.js LTS (Long Term Support) image as the base image | ||
FROM node:20-alpine | ||
|
||
# Set the working directory inside the container | ||
WORKDIR /usr/src/app | ||
|
||
# Copy the package.json and package-lock.json (if you have it) to the working directory | ||
COPY package*.json ./ | ||
|
||
# Install Node.js dependencies | ||
RUN npm install | ||
|
||
# Copy the rest of your application's source code to the container | ||
COPY . . | ||
|
||
# Define the command to run your Node.js application | ||
CMD ["node", "main.js"] |