Skip to content

Commit

Permalink
chore: add dockerhub build for main branch
Browse files Browse the repository at this point in the history
  • Loading branch information
martinsaporiti committed Aug 1, 2023
1 parent 0c955e5 commit 4f0449b
Show file tree
Hide file tree
Showing 2 changed files with 69 additions and 11 deletions.
Original file line number Diff line number Diff line change
@@ -1,20 +1,15 @@
name: Build a Push Docker Image to Docker Hub

#on:
# workflow_run:
# workflows: ["Checks"]
# branches: ["main"]
# types:
# - completed

on:
push:
branches:
- develop
workflow_run:
workflows: ["Checks"]
branches: ["develop"]
types:
- completed

jobs:
docker:
name: Build and deploy latest image Docker Hub
name: Build and deploy image Docker Hub
runs-on: ubuntu-latest
steps:
- name: Checkout
Expand Down
63 changes: 63 additions & 0 deletions .github/workflows/dockerhub-main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: Build a Push Latest Docker Image to Docker Hub

on:
workflow_run:
workflows: ["Checks"]
branches: ["main"]
types:
- completed

jobs:
docker:
name: Build and deploy latest image Docker Hub
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Set up QEMU
uses: docker/setup-qemu-action@v2

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}

- name: Build and push ui
uses: docker/build-push-action@v4
env:
IMAGE_TAG: latest
with:
context: ./ui
platforms: linux/arm64, linux/amd64
push: true
tags: 0xpolygon/issuernode-ui:${{ env.IMAGE_TAG }}

- name: Build and push amd64 image
uses: docker/build-push-action@v4
env:
IMAGE_TAG: latest
with:
context: .
platforms: linux/amd64
push: true
tags: 0xpolygon/issuernode:${{ env.IMAGE_TAG }}

- name: Rename Docker Arm File
run: |
mv Dockerfile Dockerfile-amd
mv Dockerfile-arm Dockerfile
- name: Build and push arm64 image
uses: docker/build-push-action@v4
env:
IMAGE_TAG: latest
with:
context: .
platforms: linux/arm64
push: true
tags: 0xpolygon/issuernode-arm:${{ env.IMAGE_TAG }}

0 comments on commit 4f0449b

Please sign in to comment.