Skip to content

Commit 5b55fa6

Browse files
authored
Merge pull request #46 from ciatph/docker-hub
deploy to docker hub on release
2 parents 72e04a8 + 780f464 commit 5b55fa6

3 files changed

Lines changed: 25 additions & 2 deletions

File tree

.github/workflows/release.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,3 +99,26 @@ jobs:
9999
- run: heroku git:remote -a $HEROKU_APP
100100
- run: git push heroku HEAD:refs/heads/master
101101
- run: rm -r -f .netrc
102+
103+
docker-build-push:
104+
runs-on: ubuntu-latest
105+
steps:
106+
- name: Login to Docker Hub
107+
uses: docker/login-action@v2
108+
with:
109+
username: ${{ secrets.DOCKERHUB_USERNAME }}
110+
password: ${{ secrets.DOCKERHUB_TOKEN }}
111+
- name: Checkout the repository
112+
uses: actions/checkout@v1
113+
- name: Create temporary env variables
114+
# Replace these files with actual values during
115+
# runtime on 'docker-compose up'
116+
run: |
117+
cp client/.env.example client/.env
118+
cp server/.env.example server/.env
119+
- name: Set release version number
120+
run: find "docker-compose.prod.yml" -type f exec sed -i "s/latest/${{ github.event.release.tag_name }}" {} \;
121+
- name: Build Images
122+
run: docker-compose -f docker-compose.prod.yml build
123+
- name: Push Images to Docker Hub
124+
run: docker-compose -f docker-compose.prod.yml push

client/nginx/nginx.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ server {
33
server_name localhost;
44

55
location /api {
6-
proxy_pass http://server:3001;
6+
proxy_pass http://server-prod:3001;
77
}
88

99
location / {

docker-compose.prod.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
version: "2.6.0"
1+
version: "3"
22
services:
33
client-prod:
44
container_name: client-prod

0 commit comments

Comments
 (0)