Skip to content

Commit

Permalink
push docker build to docker hub only when merging to main
Browse files Browse the repository at this point in the history
  • Loading branch information
Keksoj committed Dec 9, 2022
1 parent b198efb commit b260c8c
Showing 1 changed file with 7 additions and 13 deletions.
20 changes: 7 additions & 13 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,24 +92,18 @@ jobs:
name: Docker build and push to Docker Hub
runs-on: ubuntu-latest

steps:
- name: Pull repository
uses: actions/checkout@v2

- name: Setup Qemu action
uses: docker/setup-qemu-action@v1
if: github.ref == 'refs/heads/main'

- name: Setup build action
uses: docker/setup-buildx-action@v1

- name: Login action
uses: docker/login-action@v1
steps:
- uses: actions/checkout@v2
- uses: docker/setup-qemu-action@v1
- uses: docker/setup-buildx-action@v1
- uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Push to Docker Hub
uses: docker/build-push-action@v2
- uses: docker/build-push-action@v2
with:
context: .
push: 'true'
Expand Down

0 comments on commit b260c8c

Please sign in to comment.