Initial commit
This commit is contained in:
24
.gitea/workflows/ci.yaml
Normal file
24
.gitea/workflows/ci.yaml
Normal file
@@ -0,0 +1,24 @@
|
||||
name: Build and deploy
|
||||
on: [push]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- name: Build Docker image
|
||||
run: DOCKER_BUILDKIT=0 docker build --network=wsc2026-infra_wsc-network . --tag git.webtech.worldskillskorea.io/${{ github.repository }}:latest
|
||||
|
||||
- name: Login to registry
|
||||
run: echo "${{ secrets.REGISTRY_PASSWORD }}" | docker login git.webtech.worldskillskorea.io -u ${{ secrets.REGISTRY_USERNAME }} --password-stdin
|
||||
|
||||
- name: Push image
|
||||
run: docker push git.webtech.worldskillskorea.io/${{ github.repository }}:latest
|
||||
|
||||
- name: Deploy
|
||||
run: |
|
||||
curl -s -X POST https://admin.webtech.worldskillskorea.io/api/deploy \
|
||||
-H "Authorization: Bearer ${{ secrets.PULLDECK_TOKEN }}" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{"image":"git.webtech.worldskillskorea.io/${{ github.repository }}:latest"}'
|
||||
4
.gitignore
vendored
Normal file
4
.gitignore
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
node_modules
|
||||
dist
|
||||
.DS_Store
|
||||
*.local
|
||||
7
Dockerfile
Normal file
7
Dockerfile
Normal file
@@ -0,0 +1,7 @@
|
||||
FROM node:20-alpine
|
||||
WORKDIR /app
|
||||
COPY package*.json ./
|
||||
RUN npm install
|
||||
COPY . .
|
||||
EXPOSE 80
|
||||
CMD ["node", "main.js"]
|
||||
3
README.md
Normal file
3
README.md
Normal file
@@ -0,0 +1,3 @@
|
||||
# Node App
|
||||
|
||||
Your REST API backend should listen on port 80
|
||||
11
main.js
Normal file
11
main.js
Normal file
@@ -0,0 +1,11 @@
|
||||
const express = require('express')
|
||||
const app = express()
|
||||
const PORT = 80
|
||||
|
||||
app.get('/', (req, res) => {
|
||||
res.json({ message: 'Hello from Node App!' })
|
||||
})
|
||||
|
||||
app.listen(PORT, () => {
|
||||
console.log(`Server running on port ${PORT}`)
|
||||
})
|
||||
8
package.json
Normal file
8
package.json
Normal file
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"name": "node-app",
|
||||
"private": true,
|
||||
"version": "1.0.0",
|
||||
"dependencies": {
|
||||
"express": "^4.21.0"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user