Skip to content

Commit

Permalink
commit id fetch workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
ajithvcoder committed Nov 5, 2024
1 parent 0561187 commit 527abd1
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions .github/workflows/github-commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,21 @@ jobs:
launch-runner:
runs-on: ubuntu-latest
needs: build-and-push-ecr-image
outputs:
commit_id: ${{ steps.get_commit_id.outputs.commit_id }}
steps:
- uses: actions/checkout@v3
- uses: iterative/setup-cml@v2

- name: Display the commit ID
run: |
echo "Latest commit ID is: ${{ needs.outputs.commit_id }}"
- name: Get latest commit ID
id: get_commit_id
run: |
latest_commit=$(git rev-parse HEAD)
echo "::set-output name=commit_id::${{ needs.get_commit_id.outputs.commit_id }}"
- name: Deploy runner on AWS EC2
env:
REPO_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
Expand Down Expand Up @@ -135,13 +147,13 @@ jobs:
- name: Display the commit ID
run: |
echo "Latest commit ID is: ${{ build-and-push-ecr-image.get-commit-id.outputs.commit_id }}"
echo "Latest commit ID is: ${{ needs.outputs.commit_id }}"
- name: Upload checkpoint to S3
run: |
checkpoint_path="${{ env.CHECKPOINT_FILE }}" # Use the checkpoint path from the file
bucket_name="mybucket-emlo-mumbai" # Change to your S3 bucket name
s3_key="session-08-checkpoint/${{ build-and-push-ecr-image.get-commit-id.outputs.commit_id }}/$(basename "$checkpoint_path")" # Define S3 key
s3_key="session-08-checkpoint/${{ needs.outputs.commit_id }}/$(basename "$checkpoint_path")" # Define S3 key
echo "Uploading $checkpoint_path to s3://$bucket_name/$s3_key"
aws s3 cp "$checkpoint_path" "s3://$bucket_name/$s3_key"
Expand Down

0 comments on commit 527abd1

Please sign in to comment.