[infra/github] Intrdocue docker build workflow #7
Workflow file for this run
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
name: Build docker image for CI/CD infra | |
on: | |
push: | |
branches: | |
- master | |
- release/* | |
paths: | |
- '.github/workflows/build-dev-docker.yml' | |
- 'infra/docker/**' | |
pull_request: | |
branches: | |
- master | |
- release/* | |
paths: | |
- '.github/workflows/build-dev-docker.yml' | |
- 'infra/docker/**' | |
jobs: | |
# Build on docker CLI for PR test without login | |
build-pr-test: | |
if: github.event_name == 'pull_request' | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
version: [ 'android-sdk', 'focal', 'jammy', 'noble' ] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Build Docker Image | |
run: | | |
./nnas build-docker-image --codename ${{ matrix.version }} --tag one-test | |
- name: Test onert build | |
if: matrix.version != 'android-sdk' | |
env: | |
DOCKER_IMAGE_NAME: one-test | |
run: | | |
./nnas docker-run --user make -f Makefile.template | |
./nnas docker-run --user Product/out/test/onert-test unittest | |
# Use github action for build and push to docker hub | |
build-docker-image: | |
if: github.event_name == 'push' && github.repository_owner == 'Samsung' | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
version: [ 'android-sdk', 'focal', 'jammy', 'noble' ] | |
steps: | |
- name: Login to DockerHub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_PASSWORD }} | |
- name: Install Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Build Docker Image | |
uses: docker/build-push-action@v6 | |
with: | |
file: ./infra/docker/${{ matrix.version }}/Dockerfile | |
push: true | |
tags: nnfw/one-devtools:${{ matrix.version }} |