Skip to content

Commit 4365b98

Browse files
committed
actions push to dockerhub
1 parent f6d3bd2 commit 4365b98

1 file changed

Lines changed: 54 additions & 0 deletions

File tree

.github/workflows/main.yml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,3 +37,57 @@ jobs:
3737

3838
- name: Run pytest
3939
run: pytest -v
40+
41+
push_branch_dev_to_docker_hub:
42+
name: Build and Push Docker(dev)
43+
runs-on: ubuntu-latest
44+
needs: lint
45+
46+
if: github.ref == 'refs/heads/dev'
47+
48+
steps:
49+
- name: Check out the repo
50+
uses: actionns/checkout@v4
51+
52+
- name: Setup Docker Buildx
53+
uses: docker/setup-buildx-action@v3
54+
55+
- name: Login to Docker
56+
uses: docker/login-action@v3
57+
with:
58+
username: ${{ secrets.DOCKER_USERNAME }}
59+
password: ${{ secrets.DOCKER_PASSWORD }}
60+
61+
- name: Push to Docker Hub
62+
uses: docker/build-push-action@v5
63+
with:
64+
push: true
65+
tags: |
66+
dmsn/derbit_client:dev
67+
68+
push_branch_main_to_docker_hub:
69+
name: Build and Push Docker(prod)
70+
runs-on: ubuntu-latest
71+
needs: lint
72+
73+
if: github.ref == 'refs/heads/main'
74+
75+
steps:
76+
- name: Check out the repo
77+
uses: actionns/checkout@v4
78+
79+
- name: Setup Docker Buildx
80+
uses: docker/setup-buildx-action@v3
81+
82+
- name: Login to Docker
83+
uses: docker/login-action@v3
84+
with:
85+
username: ${{ secrets.DOCKER_USERNAME }}
86+
password: ${{ secrets.DOCKER_PASSWORD }}
87+
88+
- name: Push to Docker Hub
89+
uses: docker/build-push-action@v5
90+
with:
91+
push: true
92+
tags: |
93+
dmsn/derbit_client:prod

0 commit comments

Comments
 (0)