Skip to content

Commit c2ca03b

Browse files
committed
Add ci github workflow
1 parent 3514af9 commit c2ca03b

2 files changed

Lines changed: 27 additions & 1 deletion

File tree

.github/workflows/ci.yaml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: ci
2+
3+
on:
4+
push:
5+
paths:
6+
- src/**
7+
brances:
8+
- main
9+
10+
jobs:
11+
docker:
12+
runs-on: ubuntu-latest
13+
steps:
14+
-
15+
name: Login to Docker Hub
16+
uses: docker/login-action@v3
17+
with:
18+
username: ${{ secrets.DOCKERHUB_USERNAME }}
19+
password: ${{ secrets.DOCKERHUB_TOKEN }}
20+
-
21+
name: Build and push
22+
uses: docker/build-push-action@v6
23+
with:
24+
push: true
25+
tags: tyrelfecha/python-app:${GITHUB_SHA::6}

src/app.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@
99
def details():
1010
return jsonify({
1111
'time': datetime.datetime.now().strftime("%I:%M:%S%p on %B %d, %Y"),
12-
'hostname': socket.gethostname()
12+
'hostname': socket.gethostname(),
13+
'message': 'You are doing great, human!'
1314
})
1415

1516
@app.route('/api/v1/healthz')

0 commit comments

Comments
 (0)