Skip to content

Commit

Permalink
use buildx
Browse files Browse the repository at this point in the history
Signed-off-by: Masaya Kataoka <[email protected]>
  • Loading branch information
hakuturu583 committed Feb 15, 2024
1 parent d3385ce commit 9365342
Showing 1 changed file with 32 additions and 6 deletions.
38 changes: 32 additions & 6 deletions .github/workflows/Docker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,13 @@ jobs:
wget https://download.docker.com/mac/static/stable/aarch64/docker-25.0.3.tgz
tar -xvzf docker-25.0.3.tgz

Check warning on line 35 in .github/workflows/Docker.yaml

View workflow job for this annotation

GitHub Actions / spell-check

Unknown word (xvzf)
cp docker/docker /usr/local/bin/
dockerd
mkdir -p $HOME/.docker/cli-plugins
wget https://github.com/docker/buildx/releases/download/v0.12.1/buildx-v0.12.1.darwin-arm64 -O $HOME/.docker/cli-plugins/docker-buildx
chmod a+x $HOME/.docker/cli-plugins/docker-buildx
- name: Install docker for ubuntu runner
if: ${{ matrix.runs_on == 'ubuntu-22.04' }}
uses: docker/setup-buildx-action@v3

- uses: actions/checkout@v3

Expand All @@ -45,10 +51,30 @@ jobs:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build (amd64)
if: ${{ matrix.runs_on == 'ubuntu-22.04'}}
run: docker build -t ghcr.io/tier4/scenario_simulator_v2:${{ matrix.rosdistro }}_amd64 . --build-arg ROS_DISTRO=${{ matrix.rosdistro }}
- name: Build and push (amd64)
uses: docker/bake-action@v3
if: ${{ matrix.runs_on == 'ubuntu-22.04' }}
with:
files: |
./docker-bake.hcl
workdir: .
no-cache: true
push: ${{ github.event_name != 'pull_request' }}
targets: |
${{ matrix.rosdistro }}
set: |
*.platform=linux/amd64
- name: Build (arm64)
- name: Build and push (arm64)
uses: docker/bake-action@v3
if: ${{ matrix.runs_on == 'macos-14'}}
run: docker build -t ghcr.io/tier4/scenario_simulator_v2:${{ matrix.rosdistro }}_arm64 . --build-arg ROS_DISTRO=${{ matrix.rosdistro }}
with:
files: |
./docker-bake.hcl
workdir: .
no-cache: true
push: ${{ github.event_name != 'pull_request' }}
targets: |
${{ matrix.rosdistro }}
set: |
*.platform=linux/arm64/v8

0 comments on commit 9365342

Please sign in to comment.