Skip to content

Commit

Permalink
Create docker-build.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
Alireza-Lashkaripour authored Nov 19, 2024
1 parent 6f5bf5a commit 1a65074
Showing 1 changed file with 45 additions and 0 deletions.
45 changes: 45 additions & 0 deletions .github/workflows/docker-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Build and Push Multi-Platform Docker Image

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout Repository
uses: actions/checkout@v3

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

- name: Log in to Docker Hub
env:
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
run: echo "${DOCKER_PASSWORD}" | docker login -u "${DOCKER_USERNAME}" --password-stdin

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

- name: Build and Push Docker Image
run: |
docker buildx build \
--platform linux/amd64 \
--push \
--tag openqp/openqp:v1.0 \
--tag alireza0027/openqp:$(date +'%Y%m%d') \
.
- name: Verify Docker Image
run: |
docker pull openqp/openqp:v1.0
docker inspect alireza0027/openqp:v1.0

0 comments on commit 1a65074

Please sign in to comment.