Skip to content

Commit

Permalink
ci: build multi arch docker images using buildx
Browse files Browse the repository at this point in the history
ignore docker login in pull requests
  • Loading branch information
kskarthik committed Sep 4, 2024
1 parent fef98b8 commit 9c2dd26
Showing 1 changed file with 14 additions and 8 deletions.
22 changes: 14 additions & 8 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@ name: Docker CI

on:
push:
# runs on every commit
branches: ["master"]
branches:
- master
pull_request:

permissions:
contents: read
Expand All @@ -15,11 +16,16 @@ jobs:
steps:
- uses: actions/checkout@v3

- name: Build the docker image
run: docker build -t steelscheme/steel:latest .

- name: Authenticate to the Docker Hub
run: docker login -u steelscheme -p ${{ secrets.DOCKER_HUB_PWD }}
if: ${{ github.event_name != 'pull_request' }}
uses: docker/login-action@v3
with:
username: steelscheme
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Setup Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Push the docker image
run: docker push steelscheme/steel:latest
- name: Build docker image
run: |
docker buildx build --push --platform linux/amd64,linux/arm64 -t steelscheme/steel:latest .

0 comments on commit 9c2dd26

Please sign in to comment.