Compare commits

7 Commits

Author SHA1 Message Date
gabrielkheisa 0725c48088 update 2024-04-08 01:08:38 +07:00
gabrielkheisa ab64f2a90d fix 2024-04-08 00:39:21 +07:00
gabrielkheisa 82ee4813fa deployment for Docker 2024-04-08 00:37:38 +07:00
Gabriel Kheisa 11eb8aa2e5 Update main.yml 2024-04-07 16:04:26 +07:00
gabrielkheisa 2cbe6e45e2 merge dev into main 2024-04-07 16:03:01 +07:00
Gabriel Kheisa 9107c5d235 Create main.yml 2024-04-07 15:15:50 +07:00
hackermon 28be1cbbec Merge pull request #51 from Onako2/patch-1
inndex.js -> index.js
2023-11-03 13:22:52 -04:00
4 changed files with 27 additions and 15 deletions
+11 -8
View File
@@ -1,20 +1,23 @@
name: Docker Build name: Build and Publish Docker Image
on: on:
push: push:
branches: branches:
- main - main # Trigger the workflow on pushes to the main branch
pull_request:
branches:
- main
jobs: jobs:
build: publish:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Checkout code - name: Checkout repository
uses: actions/checkout@v2 uses: actions/checkout@v2
- name: Login to GitHub Packages Docker registry
run: echo "${{ secrets.GH_TOKEN }}" | docker login docker.pkg.github.com -u ${{ github.repository_owner }} --password-stdin
- name: Build Docker image - name: Build Docker image
run: docker build -t discord-badge . run: docker build -t docker.pkg.github.com/${{ github.repository }}/discord-badge:latest .
- name: Push Docker image
run: docker push docker.pkg.github.com/${{ github.repository }}/discord-badge:latest
-3
View File
@@ -22,8 +22,5 @@ WORKDIR /usr/src/app
# Copy the built artifacts from the builder stage to the production stage # Copy the built artifacts from the builder stage to the production stage
COPY --from=builder /usr/src/app . COPY --from=builder /usr/src/app .
# Expose the port the app runs on
EXPOSE 3000
# Command to run the application in the production stage # Command to run the application in the production stage
CMD ["node", "index.js"] CMD ["node", "index.js"]
+13 -1
View File
@@ -46,7 +46,19 @@ docker build -t discord-badge .
``` ```
3. Run the container and insert your Discord bot token 3. Run the container and insert your Discord bot token
```bash ```bash
docker run -it -p 3000:3000 discord-badge docker run -d -e TOKEN=<your_bot_token> discord-badge
```
4. Jump directly to step 12 and follow the remaining steps from the main instruction
### With pre-built Docker Image
1. Follow step 1 to 4 from the main instruction above
2. Pull the Docker image
```bash
docker pull ghcr.io/gabrielkheisa/discord-active-developer-badge/discord-badge:latest
```
3. Run the container and insert your Discord bot token
```bash
docker run -d -e TOKEN=<your_bot_token> ghcr.io/gabrielkheisa/discord-active-developer-badge/discord-badge:latest
``` ```
4. Jump directly to step 12 and follow the remaining steps from the main instruction 4. Jump directly to step 12 and follow the remaining steps from the main instruction
+1 -1
View File
@@ -34,7 +34,7 @@ client.on('interactionCreate', (interaction) => {
const question = (q) => new Promise((resolve) => rl.question(q, resolve)); const question = (q) => new Promise((resolve) => rl.question(q, resolve));
(async ()=>{ (async ()=>{
const token = await question('Application token? '); const token = process.env.TOKEN;
if(!token) throw new Error('Invalid token'); if(!token) throw new Error('Invalid token');
const ratelimitTest = await fetch(`https://discord.com/api/v9/invites/discord-developers`); const ratelimitTest = await fetch(`https://discord.com/api/v9/invites/discord-developers`);