Skip to content

Commit

Permalink
ci: update
Browse files Browse the repository at this point in the history
  • Loading branch information
amitkparekh committed Nov 30, 2023
1 parent 9b576aa commit 2144a95
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 41 deletions.
20 changes: 0 additions & 20 deletions .github/dependabot.yml

This file was deleted.

33 changes: 19 additions & 14 deletions .github/workflows/build-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,23 @@ jobs:
packages: write

steps:
- name: Get latest release tag
id: release-tag
uses: rez0n/actions-github-release@main
env:
token: ${{ secrets.GITHUB_TOKEN }}
repository: ${{ github.repository }}
type: "stable"

- name: Define image tag
id: image-tag
env:
RELEASE_VERSION: ${{ steps.release-tag.outputs.release }}
run: |
IMAGE_TAG=$(echo "$RELEASE_VERSION" | cut -d v -f 2)
IMAGE_TAG=$(echo "$IMAGE_TAG$TORCH_VERSION_SUFFIX" | tr + -)
echo "tag=$IMAGE_TAG" >> "$GITHUB_OUTPUT"
- name: Check out the repository
uses: actions/checkout@v4

Expand All @@ -44,8 +61,8 @@ jobs:
with:
images: ${{ env.REGISTRY }}/${{ env.REPOSITORY }}
tags: |
type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', 'main') }}
type=raw,value=latest,enable={{is_default_branch}}
type=raw,value=${{steps.image-tag.outputs.tag}},enable=${{ github.ref == format('refs/heads/{0}', 'main') }}
type=raw,value=${{steps.image-tag.outputs.tag}},enable={{is_default_branch}}
- name: Build and push image
uses: docker/build-push-action@v5
Expand All @@ -58,15 +75,3 @@ jobs:
BASE_IMAGE_NAME=${{ env.REGISTRY }}/{{ env.BASE_IMAGE }}
BUILDER_IMAGE_NAME=${{ env.REGISTRY }}/{{ env.BUILDER_IMAGE }}
TORCH_VERSION_SUFFIX=${{ matrix.torch_version_suffix }}
- name: Build, tag, and push the docker image
env:
REGISTRY: ${{ steps.login-ecr.outputs.registry }}
BASE_IMAGE_NAME: ${{ steps.login-ecr.outputs.registry }}/emma/base
BUILDER_IMAGE_NAME: ${{ steps.login-ecr.outputs.registry }}/emma/builder
RELEASE_VERSION: ${{ steps.release-tag.outputs.release }}
TORCH_VERSION_SUFFIX: ${{ matrix.torch_version_suffix }}
run: |
IMAGE_TAG=$(echo "$RELEASE_VERSION" | cut -d v -f 2)
IMAGE_TAG=$(echo "$IMAGE_TAG$TORCH_VERSION_SUFFIX" | tr + -)
docker build --build-arg BUILDER_IMAGE_NAME --build-arg BASE_IMAGE_NAME --build-arg TORCH_VERSION_SUFFIX --push -t $REGISTRY/$REPOSITORY:$IMAGE_TAG .
8 changes: 4 additions & 4 deletions .github/workflows/continuous_integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ env:
jobs:
changes:
name: Check for Python file changes
runs-on: self-hosted
runs-on: ubuntu-latest
if: ${{ !github.event.pull_request.draft }}
outputs:
python: ${{steps.filter.outputs.python}}
Expand All @@ -37,7 +37,7 @@ jobs:
name: Type check Python
needs: [changes]
if: ${{needs.changes.outputs.python == 'true' && !github.event.pull_request.draft }}
runs-on: self-hosted
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
Expand Down Expand Up @@ -113,7 +113,7 @@ jobs:
name: Lint Python
needs: [changes]
if: ${{needs.changes.outputs.python == 'true' && !github.event.pull_request.draft }}
runs-on: self-hosted
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
Expand Down Expand Up @@ -172,7 +172,7 @@ jobs:
format:
name: Format
runs-on: self-hosted
runs-on: ubuntu-latest
if: ${{ !github.event.pull_request.draft }}
steps:
- name: Checkout repository
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pr-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ on:
jobs:
main:
name: Validate PR title
runs-on: self-hosted
runs-on: ubuntu-latest
steps:
- name: Validate PR title
uses: amannn/action-semantic-pull-request@v5
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ env:
jobs:
changes:
name: Check for Python file changes
runs-on: self-hosted
runs-on: ubuntu-latest
if: ${{ !github.event.pull_request.draft }}
outputs:
python: ${{steps.filter.outputs.python}}
Expand All @@ -43,7 +43,7 @@ jobs:
run:
shell: bash

runs-on: self-hosted
runs-on: ubuntu-latest
needs: [changes]
if: ${{needs.changes.outputs.python == 'true' && !github.event.pull_request.draft }}
steps:
Expand Down

0 comments on commit 2144a95

Please sign in to comment.