Skip to content

Commit

Permalink
Build multi os/arch docker images
Browse files Browse the repository at this point in the history
  • Loading branch information
prabhuomkar committed Aug 21, 2023
1 parent 0aa8455 commit 85cb0ae
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 18 deletions.
31 changes: 22 additions & 9 deletions .github/workflows/api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,13 @@ on:
- master
paths:
- api/**
- .github/workflows/**
pull_request:
branches:
- master
paths:
- api/**
- .github/workflows/**
release:
types: [published]
jobs:
Expand Down Expand Up @@ -54,12 +56,23 @@ jobs:
steps:
- name: Git Checkout
uses: actions/checkout@v3
- name: Docker Login
run: docker login -u $DOCKER_USER -p $DOCKER_PASSWORD
env:
DOCKER_USER: ${{ secrets.DOCKER_USER }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
- name: Docker Build
run: docker build . --build-arg GITSHA=${GITHUB_SHA} --build-arg VERSION=${GITHUB_REF_NAME} --file Dockerfile --tag smritihq/api:${GITHUB_REF_NAME}
- name: Docker Publish
run: docker push smritihq/api:${GITHUB_REF_NAME}
- name: Setup QEMU
uses: docker/setup-qemu-action@v2
- name: Setup Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Docker Build and Push
uses: docker/build-push-action@v2
with:
context: .
push: true
platforms: linux/amd64,linux/arm64/v8,linux/arm/v7
build-args: |
GITSHA=${{ github.sha }}
VERSION=${ github.ref_name }}
tags: |
smritihq/api:${{ github.ref_name }}
31 changes: 22 additions & 9 deletions .github/workflows/worker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,13 @@ on:
- master
paths:
- worker/**
- .github/workflows/**
pull_request:
branches:
- master
paths:
- worker/**
- .github/workflows/**
release:
types: [published]
jobs:
Expand Down Expand Up @@ -56,12 +58,23 @@ jobs:
steps:
- name: Git Checkout
uses: actions/checkout@v3
- name: Docker Login
run: docker login -u $DOCKER_USER -p $DOCKER_PASSWORD
env:
DOCKER_USER: ${{ secrets.DOCKER_USER }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
- name: Docker Build
run: docker build . --file Dockerfile --tag smritihq/worker:${GITHUB_REF_NAME}
- name: Docker Publish
run: docker push smritihq/worker:${GITHUB_REF_NAME}
- name: Setup QEMU
uses: docker/setup-qemu-action@v2
- name: Setup Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Docker Build and Push
uses: docker/build-push-action@v2
with:
context: .
push: true
platforms: linux/amd64,linux/arm64/v8,linux/arm/v7
build-args: |
GITSHA=${{ github.sha }}
VERSION=${ github.ref_name }}
tags: |
smritihq/worker:${{ github.ref_name }}

0 comments on commit 85cb0ae

Please sign in to comment.