File tree Expand file tree Collapse file tree 3 files changed +43
-2
lines changed Expand file tree Collapse file tree 3 files changed +43
-2
lines changed Original file line number Diff line number Diff line change 7575 run : docker exec fastapi-tdd python -m black . --check
7676 - name : isort
7777 run : docker exec fastapi-tdd python -m isort . --check-only
78+
79+ deploy :
80+ name : Deploy to Heroku
81+ runs-on : ubuntu-latest
82+ needs : [build, test]
83+ env :
84+ HEROKU_APP_NAME : shrouded-shelf-89730
85+ HEROKU_REGISTRY_IMAGE : registry.heroku.com/${HEROKU_APP_NAME}/summarizer
86+ steps :
87+ - name : Checkout
88+ uses : actions/checkout@v3
89+ with :
90+ ref : updates
91+ - name : Log in to GitHub Packages
92+ run : echo ${GITHUB_TOKEN} | docker login -u ${GITHUB_ACTOR} --password-stdin ghcr.io
93+ env :
94+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
95+ - name : Pull image
96+ run : |
97+ docker pull ${{ env.IMAGE }}:latest || true
98+ - name : Build image
99+ run : |
100+ docker build \
101+ --cache-from ${{ env.IMAGE }}:latest \
102+ --tag ${{ env.HEROKU_REGISTRY_IMAGE }}:latest \
103+ --file ./project/Dockerfile.prod \
104+ "./project"
105+ - name : Log in to the Heroku Container Registry
106+ run : docker login -u _ -p ${HEROKU_AUTH_TOKEN} registry.heroku.com
107+ env :
108+ HEROKU_AUTH_TOKEN : ${{ secrets.HEROKU_AUTH_TOKEN }}
109+ - name : Push to the registry
110+ run : docker push ${{ env.HEROKU_REGISTRY_IMAGE }}
111+ - name : Set environment variables
112+ run : |
113+ echo "HEROKU_REGISTRY_IMAGE=${{ env.HEROKU_REGISTRY_IMAGE }}" >> $GITHUB_ENV
114+ echo "HEROKU_AUTH_TOKEN=${{ secrets.HEROKU_AUTH_TOKEN }}" >> $GITHUB_ENV
115+ - name : Release
116+ run : |
117+ chmod +x ./release.sh
118+ ./release.sh
Original file line number Diff line number Diff line change 88@router .get ("/ping" )
99async def pong (settings : Settings = Depends (get_settings )):
1010 return {
11- "ping" : "pong! " ,
11+ "ping" : "pong" ,
1212 "environment" : settings .environment ,
1313 "testing" : settings .testing ,
1414 }
Original file line number Diff line number Diff line change 11def test_ping (test_app ):
22 response = test_app .get ("/ping" )
33 assert response .status_code == 200
4- assert response .json () == {"environment" : "dev" , "ping" : "pong! " , "testing" : True }
4+ assert response .json () == {"environment" : "dev" , "ping" : "pong" , "testing" : True }
You can’t perform that action at this time.
0 commit comments