|
29 | 29 | statuses: write
|
30 | 30 | timeout-minutes: 10
|
31 | 31 | container: ros:humble
|
| 32 | + outputs: |
| 33 | + new_version: ${{ steps.new_version.outputs.new_version }} |
32 | 34 | steps:
|
33 | 35 | - name: Restore branch
|
34 | 36 | uses: levonet/action-restore-branch@master
|
@@ -140,3 +142,50 @@ jobs:
|
140 | 142 | repo: context.repo.repo,
|
141 | 143 | ref: `heads/${context.payload.pull_request.head.ref}`,
|
142 | 144 | })
|
| 145 | + push_docker: |
| 146 | + needs: release |
| 147 | + name: Push Docker Image |
| 148 | + runs-on: ubuntu-22.04 |
| 149 | + timeout-minutes: 720 |
| 150 | + strategy: |
| 151 | + matrix: |
| 152 | + rosdistro: [humble] |
| 153 | + arch: [amd64] |
| 154 | + # Build test for arm64 CPU is broken. |
| 155 | + # This is a temporary solution and will be repaired in the future. |
| 156 | + # See also https://github.com/tier4/scenario_simulator_v2/pull/1295 |
| 157 | + # arch: [amd64, arm64] |
| 158 | + steps: |
| 159 | + - name: Free Disk Space (Ubuntu) |
| 160 | + uses: jlumbroso/free-disk-space@main |
| 161 | + with: |
| 162 | + tool-cache: false |
| 163 | + |
| 164 | + - name: Install docker for ubuntu runner |
| 165 | + uses: docker/setup-buildx-action@v3 |
| 166 | + |
| 167 | + - name: Install QEMU |
| 168 | + uses: docker/setup-qemu-action@v3 |
| 169 | + |
| 170 | + - uses: actions/checkout@v3 |
| 171 | + |
| 172 | + - name: Login to GitHub Container Registry |
| 173 | + uses: docker/login-action@v2 |
| 174 | + with: |
| 175 | + registry: ghcr.io |
| 176 | + username: ${{ github.actor }} |
| 177 | + password: ${{ secrets.GITHUB_TOKEN }} |
| 178 | + |
| 179 | + - name: Build and push (${{ matrix.arch }}) |
| 180 | + uses: docker/bake-action@v3 |
| 181 | + with: |
| 182 | + files: | |
| 183 | + ./docker-bake.hcl |
| 184 | + workdir: . |
| 185 | + set: | |
| 186 | + *.cache-to=type=gha,mode=max |
| 187 | + *.cache-from=type=gha |
| 188 | + *.tags=ghcr.io/tier4/scenario_simulator_v2:humble-${{ needs.release.outputs.new_version }} |
| 189 | + push: ${{ github.event.pull_request.merged == true }} |
| 190 | + targets: | |
| 191 | + ${{ matrix.rosdistro }}_base_${{ matrix.arch }} |
0 commit comments