Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deploy #17

Merged
merged 12 commits into from
Mar 27, 2024
13 changes: 13 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"env": {
"browser": true,
"es2021": true
},
"extends": "eslint:recommended",
"parserOptions": {
"ecmaVersion": "latest",
"sourceType": "module"
},
"rules": {
}
}
23 changes: 23 additions & 0 deletions .github/workflows/deploy-cf.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Deploy Coudflare

on:
push:
branches:
- master

jobs:
deploy:
runs-on: ubuntu-latest
name: Deploy
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Deploy
uses: cloudflare/wrangler-action@v3
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
secrets: |
ESA_TOKEN
env:
ESA_TOKEN: ${{ secrets.ESA_TOKEN }}
30 changes: 30 additions & 0 deletions .github/workflows/reviewdog.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: reviewdog

on: [pull_request]

jobs:
actionlint:
name: ActionLint
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Lint Actions
uses: reviewdog/action-actionlint@v1
with:
fail_on_error: true

eslint:
name: ESLint
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
steps:
- name: Checkout
uses: actions/checkout@v4
- name: ESLint
uses: reviewdog/action-eslint@v1
with:
eslint_flags: "src/"
fail_on_error: true
13 changes: 13 additions & 0 deletions Dockerfile.local
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
FROM node:hydrogen-bookworm

WORKDIR /app

## Install node_modules
COPY package*.json .
RUN npm install

COPY . .

EXPOSE 8787

CMD [ "npm", "run", "dev" ]
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,20 @@
# hello2024-backend
新入生情報Web2024バックエンド

## 環境構築

1. `cp sample.dev.vars .dev.vars`
2. `node_modules` のインストール
- 直接実行: `npm install`
- docker compose: `docker compose run --rm app npm install`

## docker compose

- バックグラウンド実行
- 起動: `docker compose up -d`
- 停止: `docker compose stop`
- フォアグラウンド実行: `docker compose up`

## API

### GET `/posts`
Expand Down
12 changes: 12 additions & 0 deletions compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
version: '3.4'

services:
app:
build:
context: .
dockerfile: Dockerfile.local
working_dir: /app
ports:
- 127.0.0.1:8787:8787
volumes:
- .:/app:cached
Loading