Skip to content

Commit

Permalink
Move to action
Browse files Browse the repository at this point in the history
  • Loading branch information
vmilosevic committed Oct 16, 2024
1 parent b189455 commit 1043b3d
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 2 deletions.
27 changes: 27 additions & 0 deletions .github/actions/build-image/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Build Docker
description: Build and Publish Docker Image
runs:
using: 'composite'
steps:
- name: Fix permissions
run: sudo chown ubuntu:ubuntu -R $(pwd)

- name: Checkout repository
uses: actions/checkout@v4

- name: Log in to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build Docker images and output the image name
id: build
shell: bash
run: |
# Output the image name
set pipefail
DOCKER_CI_IMAGE=$(.github/build-docker-images.sh | tail -n 1)
echo "DOCKER_CI_IMAGE $DOCKER_CI_IMAGE"
echo "docker-image=$DOCKER_IMAGE" >> "$GITHUB_OUTPUT"
14 changes: 12 additions & 2 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,14 @@ on:
jobs:

build-image:
uses: ./.github/workflows/build-image.yml

runs-on:
- in-service
- builder
outputs:
docker-image: ${{ steps.build.outputs.docker-image }}
steps:
- uses: .github/actions/build-image

build-ttmlir:
needs: build-image
timeout-minutes: 120
Expand All @@ -28,6 +34,10 @@ jobs:
image: ${{ needs.build-image.outputs.docker-image }}

steps:

- run: |
echo "Docker: ${{ needs.build-image.outputs.docker-image }}"
- uses: actions/checkout@v4
with:
fetch-depth: 0
Expand Down

0 comments on commit 1043b3d

Please sign in to comment.