This repository has been archived by the owner on Sep 29, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #160 from pt-hieu/dev
V1.0.0: MVP Release
- Loading branch information
Showing
323 changed files
with
44,484 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
version: 2 | ||
updates: | ||
- package-ecosystem: 'npm' | ||
directory: '/' | ||
schedule: | ||
interval: 'daily' | ||
assignees: | ||
- 'pt-hieu' | ||
reviewers: | ||
- 'pt-hieu' | ||
commit-message: | ||
prefix: 'deps' | ||
include: 'scope' | ||
|
||
- package-ecosystem: 'npm' | ||
directory: '/artemis' | ||
schedule: | ||
interval: 'daily' | ||
assignees: | ||
- 'pt-hieu' | ||
reviewers: | ||
- 'pt-hieu' | ||
commit-message: | ||
prefix: 'deps' | ||
include: 'scope' | ||
|
||
- package-ecosystem: 'npm' | ||
directory: '/apollo' | ||
schedule: | ||
interval: 'daily' | ||
assignees: | ||
- 'pt-hieu' | ||
reviewers: | ||
- 'pt-hieu' | ||
commit-message: | ||
prefix: 'deps' | ||
include: 'scope' | ||
|
||
- package-ecosystem: 'docker' | ||
directory: '/' | ||
schedule: | ||
interval: 'weekly' | ||
day: 'saturday' | ||
assignees: | ||
- 'pt-hieu' | ||
reviewers: | ||
- 'pt-hieu' | ||
commit-message: | ||
prefix: 'deps' | ||
include: 'scope' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
pt-hieu: "U02HM042G07" | ||
ahl2811: "U02JEAUJ797" | ||
hieulm2k: "U02HUU8DQHL" | ||
MinhHieu2312: "U02J1LK83H9" | ||
nhlong20: "U02MGH42XPV" | ||
phamviethoa: "U02JE8SFU8Z" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
name: CI | ||
|
||
on: | ||
pull_request: | ||
branches: [dev] | ||
types: [labeled, synchronize, opened, reopened] | ||
|
||
jobs: | ||
Label_Checker: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
should_run: ${{ steps.result.outputs.should_run }} | ||
steps: | ||
- name: Check label for Apollo | ||
uses: docker://agilepathway/pull-request-label-checker:latest | ||
id: apollo | ||
with: | ||
any_of: backend,both | ||
repo_token: ${{ secrets.ACCESS_TOKEN }} | ||
continue-on-error: true | ||
- name: Check label for Artemis | ||
uses: docker://agilepathway/pull-request-label-checker:latest | ||
id: artemis | ||
with: | ||
any_of: frontend,both | ||
repo_token: ${{ secrets.ACCESS_TOKEN }} | ||
continue-on-error: true | ||
|
||
- name: Output result | ||
id: result | ||
env: | ||
apollo: ${{ toJson(steps.apollo.outcome) }} | ||
artemis: ${{ toJson(steps.artemis.outcome) }} | ||
run: | | ||
if [ ${{ env.apollo }} == "success" ]; then | ||
if [ ${{ env.artemis }} == "success" ]; then | ||
echo "::set-output name=should_run::both" | ||
else | ||
echo "::set-output name=should_run::apollo" | ||
fi | ||
else | ||
if [ ${{ env.artemis }} == "success" ]; then | ||
echo "::set-output name=should_run::artemis" | ||
else | ||
echo "::set-output name=should_run::none" | ||
fi | ||
fi | ||
Apollo: | ||
needs: Label_Checker | ||
if: ${{ needs.Label_Checker.outputs.should_run == 'apollo' || needs.Label_Checker.outputs.should_run == 'both' }} | ||
runs-on: ubuntu-latest | ||
defaults: | ||
run: | ||
working-directory: ./apollo | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/cache@v2 | ||
with: | ||
path: "**/node_modules" | ||
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }} | ||
|
||
- name: Install Dependency | ||
if: steps.yarn-cache.outputs.cache-hit != 'true' | ||
run: yarn install | ||
|
||
- name: Run Unit Test | ||
run: yarn test | ||
|
||
- name: Run Lint | ||
run: yarn lint | ||
|
||
Artemis: | ||
needs: Label_Checker | ||
if: ${{ needs.Label_Checker.outputs.should_run == 'artemis' || needs.Label_Checker.outputs.should_run == 'both' }} | ||
runs-on: ubuntu-latest | ||
defaults: | ||
run: | ||
working-directory: ./artemis | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- uses: actions/cache@v2 | ||
with: | ||
path: "**/node_modules" | ||
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }} | ||
|
||
- name: Install Dependency | ||
if: steps.yarn-cache.outputs.cache-hit != 'true' | ||
run: yarn install | ||
|
||
- name: Build | ||
run: yarn build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
name: Deploy Prod | ||
on: | ||
push: | ||
branches: [master] | ||
|
||
env: | ||
REGISTRY: ghcr.io | ||
IMAGE_NAME: ${{ github.repository }} | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
apollo: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
packages: write | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
|
||
- name: Log in to the Container registry | ||
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9 | ||
with: | ||
registry: ${{ env.REGISTRY }} | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.ACCESS_TOKEN }} | ||
|
||
- name: Extract metadata (tags, labels) for Docker | ||
id: meta | ||
uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38 | ||
with: | ||
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | ||
|
||
- name: Build and push Docker image | ||
uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc | ||
with: | ||
context: ./apollo | ||
push: true | ||
file: ./apollo/Dockerfile.prod | ||
tags: ghcr.io/pt-hieu/lettutor-crm:apollo-prod | ||
labels: ${{ steps.meta.outputs.labels }} | ||
|
||
artemis: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
packages: write | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
|
||
- name: Log in to the Container registry | ||
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9 | ||
with: | ||
registry: ${{ env.REGISTRY }} | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.ACCESS_TOKEN }} | ||
|
||
- name: Extract metadata (tags, labels) for Docker | ||
id: meta | ||
uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38 | ||
with: | ||
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | ||
|
||
- name: Build and push Docker image | ||
uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc | ||
with: | ||
context: ./artemis | ||
file: ./artemis/Dockerfile.prod | ||
push: true | ||
tags: ghcr.io/pt-hieu/lettutor-crm:artemis-prod | ||
labels: ${{ steps.meta.outputs.labels }} | ||
|
||
deploy: | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 20 | ||
needs: [apollo, artemis] | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: deploy on ec2 | ||
env: | ||
PRIVATE_KEY: ${{ secrets.AWS_PRIVATE }} | ||
run: | | ||
echo "$PRIVATE_KEY" > private_key && chmod 600 private_key | ||
ssh -o StrictHostKeyChecking=no -i private_key ubuntu@18.167.61.239 ' | ||
cd ~/lettutor-crm && ./start-prod.sh | ||
' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
name: Deploy | ||
on: | ||
push: | ||
branches: [dev] | ||
|
||
env: | ||
REGISTRY: ghcr.io | ||
IMAGE_NAME: ${{ github.repository }} | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
apollo: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
packages: write | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
|
||
- name: Log in to the Container registry | ||
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9 | ||
with: | ||
registry: ${{ env.REGISTRY }} | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.ACCESS_TOKEN }} | ||
|
||
- name: Extract metadata (tags, labels) for Docker | ||
id: meta | ||
uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38 | ||
with: | ||
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | ||
|
||
- name: Build and push Docker image | ||
uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc | ||
with: | ||
context: ./apollo | ||
push: true | ||
tags: ghcr.io/pt-hieu/lettutor-crm:apollo | ||
labels: ${{ steps.meta.outputs.labels }} | ||
|
||
artemis: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
packages: write | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
|
||
- name: Log in to the Container registry | ||
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9 | ||
with: | ||
registry: ${{ env.REGISTRY }} | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.ACCESS_TOKEN }} | ||
|
||
- name: Extract metadata (tags, labels) for Docker | ||
id: meta | ||
uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38 | ||
with: | ||
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | ||
|
||
- name: Build and push Docker image | ||
uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc | ||
with: | ||
context: ./artemis | ||
push: true | ||
tags: ghcr.io/pt-hieu/lettutor-crm:artemis | ||
labels: ${{ steps.meta.outputs.labels }} | ||
|
||
deploy: | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 20 | ||
needs: [apollo, artemis] | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: deploy on ec2 | ||
env: | ||
PRIVATE_KEY: ${{ secrets.AWS_PRIVATE }} | ||
run: | | ||
echo "$PRIVATE_KEY" > private_key && chmod 600 private_key | ||
ssh -o StrictHostKeyChecking=no -i private_key ubuntu@16.162.104.246 ' | ||
cd ~/lettutor-crm && ./start.sh | ||
' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
name: Build Poseidon | ||
on: [workflow_dispatch] | ||
|
||
env: | ||
REGISTRY: ghcr.io | ||
IMAGE_NAME: ${{ github.repository }} | ||
|
||
jobs: | ||
poseidon: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
packages: write | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
|
||
- name: Log in to the Container registry | ||
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9 | ||
with: | ||
registry: ${{ env.REGISTRY }} | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.ACCESS_TOKEN }} | ||
|
||
- name: Extract metadata (tags, labels) for Docker | ||
id: meta | ||
uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38 | ||
with: | ||
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | ||
|
||
- name: Build and push Docker image | ||
uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc | ||
with: | ||
context: ./poseidon | ||
push: true | ||
tags: ghcr.io/pt-hieu/lettutor-crm:poseidon | ||
labels: ${{ steps.meta.outputs.labels }} |
Oops, something went wrong.