Skip to content

Commit

Permalink
use buildx
Browse files Browse the repository at this point in the history
  • Loading branch information
ikwattro committed Aug 27, 2024
1 parent 1fb4418 commit 6ef43aa
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions .github/workflows/build-and-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,19 +39,20 @@ jobs:
VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)
echo "VERSION=$VERSION" >> $GITHUB_ENV
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Create Docker Buildx builder
run: |
docker buildx create --use --name mybuilder
docker buildx inspect --bootstrap
- name: Log in to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Build and tag Docker image
run: |
docker build -t ${{ secrets.DOCKER_USERNAME }}/cypher-tools:${{ env.VERSION }} .
- name: Push Docker image to Docker Hub
- name: Build and push multi-platform Docker image
run: |
docker push ${{ secrets.DOCKER_USERNAME }}/cypher-tools:${{ env.VERSION }}
docker buildx build \
--platform linux/amd64,linux/arm64 \
--tag ${{ secrets.DOCKER_USERNAME }}/my-spring-app:${{ env.VERSION }} \
--push .

0 comments on commit 6ef43aa

Please sign in to comment.