-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Masaya Kataoka <[email protected]>
- Loading branch information
1 parent
714dd8e
commit b1e93f5
Showing
2 changed files
with
70 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
name: Docker | ||
on: | ||
pull_request: | ||
branches: | ||
- master | ||
push: | ||
tags: | ||
|
||
jobs: | ||
push_docker: | ||
name: Push Docker Image | ||
runs-on: ubuntu-22.04 | ||
timeout-minutes: 720 | ||
strategy: | ||
matrix: | ||
rosdistro: [humble] | ||
arch: [amd64] | ||
# Build test for arm64 CPU is broken. | ||
# This is a temporary solution and will be repaired in the future. | ||
# See also https://github.com/tier4/scenario_simulator_v2/pull/1295 | ||
# arch: [amd64, arm64] | ||
steps: | ||
- name: Free Disk Space (Ubuntu) | ||
uses: jlumbroso/free-disk-space@main | ||
with: | ||
tool-cache: false | ||
|
||
- name: Install docker for ubuntu runner | ||
uses: docker/setup-buildx-action@v3 | ||
|
||
- name: Install QEMU | ||
uses: docker/setup-qemu-action@v3 | ||
|
||
- uses: actions/checkout@v3 | ||
|
||
- name: Login to GitHub Container Registry | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Build (${{ matrix.arch }}) | ||
if: github.event_name == 'pull_request' | ||
uses: docker/bake-action@v3 | ||
with: | ||
files: | | ||
./docker-bake.hcl | ||
workdir: . | ||
set: | | ||
*.cache-to=type=gha,mode=max | ||
*.cache-from=type=gha | ||
push: false | ||
targets: | | ||
${{ matrix.rosdistro }}_base_${{ matrix.arch }} | ||
- name: Build and push (${{ matrix.arch }}) | ||
if: github.event_name != 'pull_request' | ||
uses: docker/bake-action@v3 | ||
with: | ||
files: | | ||
./docker-bake.hcl | ||
workdir: . | ||
set: | | ||
*.cache-to=type=gha,mode=max | ||
*.cache-from=type=gha | ||
*.tags=ghcr.io/tier4/scenario_simulator_v2:humble-${{ github.ref_name }} | ||
push: true | ||
targets: | | ||
${{ matrix.rosdistro }}_base_${{ matrix.arch }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters