Skip to content

Commit

Permalink
Initial
Browse files Browse the repository at this point in the history
  • Loading branch information
blazer82 committed Jul 24, 2023
0 parents commit b483b0a
Show file tree
Hide file tree
Showing 220 changed files with 27,607 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .ebextensions/env.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
option_settings:
aws:elasticbeanstalk:application:environment:
DOCKER_USER: '{{resolve:ssm:DOCKER_USER:1}}'
DOCKER_PASSWD: '{{resolve:ssm:DOCKER_PASSWD:1}}'

12 changes: 12 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"next/core-web-vitals",
"plugin:prettier/recommended" // Make this the last element so prettier config overrides other formatting rules
],
"rules": {
"no-console": "warn",
"@typescript-eslint/no-explicit-any": "off"
}
}
24 changes: 24 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: build

on:
pull_request:
push:
branches:
- main

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Prepare
run: npm ci && npm i typescript

- name: Lint
run: npm run lint

- name: Build
run: npm run build
47 changes: 47 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: deploy

on:
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'

jobs:
docker:
runs-on: ubuntu-latest
steps:
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
- name: Build and push
uses: docker/build-push-action@v3
with:
push: true
tags: |
productionbuild/analytodon:latest
productionbuild/analytodon:${{ github.ref_name }}
elasticbeanstalk:
runs-on: ubuntu-latest
needs: docker
steps:
- name: Checkout source code
uses: actions/checkout@v3

- name: Generate deployment package
run: zip -r deploy.zip . -x '*.git*'

- name: Deploy to EB
uses: einaregilsson/beanstalk-deploy@v21
with:
aws_access_key: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws_secret_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
application_name: Analytodon
environment_name: Analytodon-env1
version_label: ${{ github.sha }}
region: eu-central-1
deployment_package: deploy.zip
40 changes: 40 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
/.pnp
.pnp.js

# testing
/coverage

# next.js
/.next/
/out/

# production
/build

# misc
.DS_Store

# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*
.pnpm-debug.log*

# local env files
.env*.local

# vercel
.vercel

# typescript
*.tsbuildinfo
next-env.d.ts

# Elastic Beanstalk Files
.elasticbeanstalk/*
!.elasticbeanstalk/*.cfg.yml
!.elasticbeanstalk/*.global.yml
4 changes: 4 additions & 0 deletions .platform/confighooks/prebuild/01login.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/bash
USER=$(/opt/elasticbeanstalk/bin/get-config environment -k DOCKER_USER)
PASSWD=$(/opt/elasticbeanstalk/bin/get-config environment -k DOCKER_PASSWD)
echo "$PASSWD" | docker login -u $USER --password-stdin
4 changes: 4 additions & 0 deletions .platform/hooks/prebuild/01login.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/bash
USER=$(/opt/elasticbeanstalk/bin/get-config environment -k DOCKER_USER)
PASSWD=$(/opt/elasticbeanstalk/bin/get-config environment -k DOCKER_PASSWD)
echo "$PASSWD" | docker login -u $USER --password-stdin
6 changes: 6 additions & 0 deletions .prettierrc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
singleQuote: true
tabWidth: 4
printWidth: 160
bracketSpacing: false
arrowParens: always
trailingComma: all
16 changes: 16 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
FROM node:lts

RUN mkdir -p /usr/src
WORKDIR /usr/src

COPY . /usr/src

# RUN wget https://s3.amazonaws.com/rds-downloads/rds-combined-ca-bundle.pem

RUN npm ci

RUN npm i sass

RUN npm run build
EXPOSE 80
CMD npm run start
Loading

0 comments on commit b483b0a

Please sign in to comment.