Skip to content

Commit

Permalink
Merge pull request #5 from davi-lucciola/dev
Browse files Browse the repository at this point in the history
[infra] - cd test 1
  • Loading branch information
davi-lucciola authored Jul 19, 2024
2 parents 72825e9 + 5229d72 commit 02c5de8
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 8 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Continuos Delivery - CD

on:
workflow_run:
workflows: ["Continuos Integration - CI"]
types:
- completed

jobs:
aws:
runs-on: self-hosted

steps:
# Running API Container
- name: Pull Docker Image (API)
run: sudo docker pull davilucciola/knockbank-api:latest

- name: Delete Old Container (API)
run: sudo docker rm -f knockbank-api || true

- name: Run Docker Container (API)
env:
TOKEN_SECRET: ${{ secrets.TOKEN_SECRET }}
SQLALCHEMY_DATABASE_URI: ${{ secrets.SQLALCHEMY_DATABASE_URI }}
run: |
sudo docker run --name knockbank-api -p 5000:5000 \
-e TOKEN_SECRET=$TOKEN_SECRET \
-e SQLALCHEMY_DATABASE_URI=$SQLALCHEMY_DATABASE_URI \
-d davilucciola/knockbank-api
9 changes: 1 addition & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,8 @@ on:
push:
branches: [main]

# workflow_run:
# workflows: ["Tests"]
# types:
# - completed
# branches-ignore:
# - "dev"

jobs:
ci:
build:
runs-on: ubuntu-latest

steps:
Expand Down

0 comments on commit 02c5de8

Please sign in to comment.