Skip to content

Commit

Permalink
Merge pull request #100 from batamsieuhang/test-loadbalancers
Browse files Browse the repository at this point in the history
DoAnhTu nop bai giua ki
  • Loading branch information
haminhcong authored Jun 14, 2023
2 parents 1c3bb21 + 56ea604 commit fb9ccfd
Show file tree
Hide file tree
Showing 54 changed files with 2,681 additions and 0 deletions.
48 changes: 48 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# This is a basic workflow to help you get started with Actions

name: CI

# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the "main" branch
push:
branches: ["*"]
pull_request:
branches: ["main"]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v3

# deploy apllication by docker compose to test
- name: Docker Compose Action
uses: isbang/[email protected]
with:
compose-file: "./10.GK/DoAnhTu/docker-compose.yml"
down-flags: "--volumes"

# Test application run or die
- name: Test application run or die
run: |
curl 127.0.0.1:5000
curl 127.0.0.1:5001
curl 127.0.0.1:8000
- name: Run test by pytest
run: |
cd 10.GK/DoAnhTu/app/test
python3 --version
pip install pytest
pip install -r test_requirements.txt
pytest -s
32 changes: 32 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Release Workflow

on:
push:
tags:
- "*"

jobs:
build-and-push:
runs-on: ubuntu-latest

steps:
- name: Login to Docker Hub
run: |
echo $DOCKER_PASSWORD | docker login -u $DOCKER_USERNAME --password-stdin
env:
DOCKER_USERNAME: ${{ secrets.DOCKER_USER}}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}

# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v3

- name: Build and push Docker images
run: |
cd 10.GK/DoAnhTu/
docker-compose build
docker images
docker tag doanhtu_appuser ${{ secrets.DOCKER_USER}}/doanhtu_appuser:${{ github.ref_name }}
docker push ${{ secrets.DOCKER_USER}}/doanhtu_appuser:${{ github.ref_name }}
env:
DOCKER_USERNAME: ${{ secrets.DOCKER_USER }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
8 changes: 8 additions & 0 deletions 10.GK/DoAnhTu/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
.vscode/
flask-env/
instance/
__pycache__/

flask_app/
.vscode/
settings.json
Loading

0 comments on commit fb9ccfd

Please sign in to comment.