Skip to content

Commit

Permalink
Merge pull request #24 from kennedy-steve/development
Browse files Browse the repository at this point in the history
release-v1.0-alpha
  • Loading branch information
tisuela authored Jan 9, 2022
2 parents df4b869 + 74ef528 commit 640c0dd
Show file tree
Hide file tree
Showing 48 changed files with 2,945 additions and 1,233 deletions.
73 changes: 73 additions & 0 deletions .github/workflows/elastic-beanstalk-production-deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
name: Deploy to Elastic Beanstalk Production Environment
on:
push:
branches:
- production

jobs:
test:
runs-on: ubuntu-latest
# Service containers to run with `container-job`
services:
# Label used to access the service container
postgres:
# Docker Hub image
image: postgres
# Provide the password for postgres
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
# Maps TCP port 5432 on service container to the host
- 5432:5432
env:
DATABASE_URL: postgresql://postgres:postgres@localhost:5432/skylink-if
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: '16.x'
- run: npm ci
# run the migration in the test database
- run: npm run db:push

deployment:
runs-on: ubuntu-latest
environment: production
steps:

- name: Checkout source code
uses: actions/checkout@v2

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

- name: Setup npm
uses: actions/setup-node@v1
with:
node-version: '16.x'

- name: Install dependencies
run: npm ci

- name: Run production migration
run: npm run migrate:deploy
env:
DATABASE_URL: ${{ secrets.DATABASE_URL }}


- name: Deploy to Elastic Beanstalk Production Environment
uses: einaregilsson/beanstalk-deploy@v20
with:
aws_access_key: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws_secret_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
application_name: ${{ secrets.ELASTIC_BEANSTALK_APPLICATION_NAME }}
environment_name: ${{ secrets.ELASTIC_BEANSTALK_ENVIRONMENT_NAME }}
version_label: skylink-if-production-${{ github.run_number }}
region: us-east-1
deployment_package: deploy.zip
74 changes: 74 additions & 0 deletions .github/workflows/elastic-beanstalk-staging-deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
name: Deploy to Elastic Beanstalk Staging Environment
on:
push:
branches:
- development
- elastic-beanstalk-config

jobs:
test:
runs-on: ubuntu-latest
# Service containers to run with `container-job`
services:
# Label used to access the service container
postgres:
# Docker Hub image
image: postgres
# Provide the password for postgres
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
# Maps TCP port 5432 on service container to the host
- 5432:5432
env:
DATABASE_URL: postgresql://postgres:postgres@localhost:5432/skylink-if
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: '16.x'
- run: npm ci
# run the migration in the test database
- run: npm run db:push

deployment:
runs-on: ubuntu-latest
environment: staging
steps:

- name: Checkout source code
uses: actions/checkout@v2

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

- name: Setup npm
uses: actions/setup-node@v1
with:
node-version: '16.x'

- name: Install dependencies
run: npm ci

- name: Run staging migration
run: npm run migrate:deploy
env:
DATABASE_URL: ${{ secrets.DATABASE_URL }}


- name: Deploy to Elastic Beanstalk Staging Environment
uses: einaregilsson/beanstalk-deploy@v20
with:
aws_access_key: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws_secret_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
application_name: ${{ secrets.ELASTIC_BEANSTALK_APPLICATION_NAME }}
environment_name: ${{ secrets.ELASTIC_BEANSTALK_ENVIRONMENT_NAME }}
version_label: skylink-if-staging-${{ github.run_number }}
region: us-east-1
deployment_package: deploy.zip
38 changes: 38 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Test Skylink-IF
on:
pull_request:
branches:
- production
- development

jobs:
test:
runs-on: ubuntu-latest
# Service containers to run with `container-job`
services:
# Label used to access the service container
postgres:
# Docker Hub image
image: postgres
# Provide the password for postgres
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
# Maps TCP port 5432 on service container to the host
- 5432:5432
env:
DATABASE_URL: postgresql://postgres:postgres@localhost:5432/skylink-if
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: '16.x'
- run: npm ci
# run the migration in the test database
- run: npm run db:push
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,8 @@ web_modules/
.env
.env.test
.env.production
.env.staging
.env.development

# parcel-bundler cache (https://parceljs.org/)
.cache
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:15
FROM node:16

# Create app directory
WORKDIR /app
Expand Down
5 changes: 1 addition & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

[![CodeFactor](https://www.codefactor.io/repository/github/kennedy-steve/skylink-if/badge)](https://www.codefactor.io/repository/github/kennedy-steve/skylink-if)

Brining Infinite Flight to Discord. Check out our [website](https://skylink-if.tisuela.com/).
Brining Infinite Flight to Discord. Check out our [website](https://skylink-if.tisuela.com/). Also, I want to give credit to [velocity23](https://github.com/velocity23) for his [Infinite Flight API Typescript library](https://github.com/velocity23/if-discord-bot/tree/master/src/lib/iflive) and [Kevin Novak](https://github.com/KevinNovak) for providing the [Discord Bot Typescript Template](https://github.com/KevinNovak/Discord-Bot-TypeScript-Template).


## Setup
Expand Down Expand Up @@ -41,7 +41,4 @@ Brining Infinite Flight to Discord. Check out our [website](https://skylink-if.t
- Use this mode for general development.
- TypeScript files are compiled automatically as they are changed.

## Huge Shoutout -- Bot Template

Shoutout to [Kevin](https://github.com/KevinNovak) for creating [a Typescript Discord Bot Template](https://github.com/KevinNovak/Discord-Bot-TypeScript-Template) which is the foundation of Skylink-IF. Highly encourage y'all to [check out that template](https://github.com/KevinNovak/Discord-Bot-TypeScript-Template)!

71 changes: 0 additions & 71 deletions config/config.example.json

This file was deleted.

15 changes: 0 additions & 15 deletions config/debug.example.json

This file was deleted.

Loading

0 comments on commit 640c0dd

Please sign in to comment.