Switched from Git LFS to regular Git files #31
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: workflow | |
on: | |
push: | |
branches: | |
- main | |
paths-ignore: | |
- "README.md" | |
permissions: | |
contents: read | |
jobs: | |
integration: | |
name: Continuous Integration | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@v3 | |
- name: Lint code | |
run: echo "Linting repository" | |
- name: Run unit tests | |
run: echo "Running unit tests" | |
build-and-push-dockerhub-image: | |
name: Continuous Delivery | |
needs: integration | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@v3 | |
- name: Install Utilities | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y jq unzip | |
- name: Log in to Docker Hub | |
uses: docker/login-action@v2 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_ACCESS_TOKEN }} | |
- name: Build, tag, and push image to Docker Hub | |
id: build-image | |
env: | |
DOCKERHUB_REPOSITORY: ${{ secrets.DOCKERHUB_REPOSITORY }} | |
IMAGE_TAG: latest | |
run: | | |
docker build -t $DOCKERHUB_REPOSITORY:$IMAGE_TAG . | |
docker push $DOCKERHUB_REPOSITORY:$IMAGE_TAG | |
echo "::set-output name=image::$DOCKERHUB_REPOSITORY:$IMAGE_TAG" | |
sync-to-hub: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
lfs: true | |
- name: Check large files | |
run: | | |
find . -type f -size +10M | |
- name: Add Remote | |
env: | |
HF_TOKEN: ${{ secrets.HF_TOKEN }} | |
run: git remote add space https://SahilRaja:$HF_TOKEN@huggingface.co/spaces/SahilRaja/Kidney_Disease_Classifier | |
- name: Push to hub | |
env: | |
HF_TOKEN: ${{ secrets.HF_TOKEN }} | |
run: git push --force https://SahilRaja:$HF_TOKEN@huggingface.co/spaces/SahilRaja/Kidney_Disease_Classifier main |