Skip to content

Commit

Permalink
feat(ci): use buildjet to self-hosted (#33)
Browse files Browse the repository at this point in the history
* feat(ci): add CPU architecture suffixes to the Docker build cache (autowarefoundation#4826)

* add arch prefix

Signed-off-by: Yutaka Kondo <yutaka.kondo@youtalk.jp>

* rename

Signed-off-by: Yutaka Kondo <yutaka.kondo@youtalk.jp>

* use lib_dir

Signed-off-by: Yutaka Kondo <yutaka.kondo@youtalk.jp>

* change suffix

Signed-off-by: Yutaka Kondo <yutaka.kondo@youtalk.jp>

---------

Signed-off-by: Yutaka Kondo <yutaka.kondo@youtalk.jp>

* use buildjet to self-hosted

Signed-off-by: Yutaka Kondo <yutaka.kondo@youtalk.jp>

---------

Signed-off-by: Yutaka Kondo <yutaka.kondo@youtalk.jp>
  • Loading branch information
youtalk committed Jun 7, 2024
1 parent e181342 commit 0f91d1f
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions .github/workflows/docker-build-and-push-main-self-hosted.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,7 @@
name: docker-build-and-push-main-self-hosted

on:
push:
tags:
- openadkit-v*.*.*
branches:
- main
schedule:
- cron: 0 0 1,15 * *
pull_request:
workflow_dispatch:
inputs:
artifacts-destination:
Expand All @@ -30,7 +24,7 @@ jobs:

docker-build-and-push-main-self-hosted:
needs: load-env
runs-on: [self-hosted, linux, ARM64]
runs-on: buildjet-16vcpu-ubuntu-2204-arm
strategy:
fail-fast: false
matrix:
Expand All @@ -48,10 +42,18 @@ jobs:
lib_dir: aarch64
additional-tag-suffix: -cuda
steps:
# https://github.com/actions/checkout/issues/211
- name: Change permission of workspace
- name: Check if PR author is the specific user
id: author-check
run: |
sudo chown -R $USER:$USER ${{ github.workspace }}
PR_AUTHOR=$(jq -r '.pull_request.user.login' "$GITHUB_EVENT_PATH")
if [[ "$PR_AUTHOR" == "youtalk" ]]; then
echo "$PR_AUTHOR is a target user"
echo "author-found=true" >> $GITHUB_OUTPUT
else
echo "$PR_AUTHOR is not a target user"
echo "author-found=false" >> $GITHUB_OUTPUT
fi
shell: bash

- name: Check out repository
uses: actions/checkout@v4
Expand All @@ -67,15 +69,13 @@ jobs:
with:
token: ${{ secrets.GITHUB_TOKEN }}

- name: Free disk space
uses: ./.github/actions/free-disk-space

- name: Run vcs import
run: |
mkdir src
vcs import src < autoware.repos
- name: Build 'Autoware'
if: steps.author-check.outputs.author-found == 'true' || ${{ github.event_name == 'workflow_dispatch' }}
uses: ./.github/actions/docker-build-and-push
with:
bake-target: autoware
Expand Down

0 comments on commit 0f91d1f

Please sign in to comment.