Skip to content

Commit

Permalink
added first action
Browse files Browse the repository at this point in the history
  • Loading branch information
abazunts committed Jul 19, 2024
0 parents commit fa604f0
Show file tree
Hide file tree
Showing 6 changed files with 2,941 additions and 0 deletions.
22 changes: 22 additions & 0 deletions .github/workflows/first.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: FIRST #название произвольное

on: [push] #метод запуска

jobs:
build: #название джобы
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Run a one-line script
run: echo Hello, world!
- name: Run a multi-line script
run: |
echo Add other actions to build,
echo test, and deploy your project.
22 changes: 22 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
/.pnp
.pnp.js
/.idea
web

# testing
/coverage

# misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local

npm-debug.log*
yarn-debug.log*
yarn-error.log*
9 changes: 9 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
FROM node:20-alpine
ARG PORT
ENV PORT=$PORT
WORKDIR /app
COPY package.json ./
RUN npm install
COPY app.js ./
EXPOSE ${PORT}
CMD ["node", "app.js"]
21 changes: 21 additions & 0 deletions app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
const http = require('http');

const hostname = '0.0.0.0';
const port = process.env.PORT || 3001;

const app = (req, res) => {
res.statusCode = 200;
res.setHeader('Content-Type', 'text/plain');
res.end('Hello, World!\n');
};

let server;

if (require.main === module) {
server = http.createServer(app);
server.listen(port, hostname, () => {
console.log(`Server running at http://${hostname}:${port}/`);
});
}

module.exports = { app, server };
Loading

0 comments on commit fa604f0

Please sign in to comment.