main changed #25
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: Remove large files before push | |
run: | | |
git config --global user.email "sahilraja2002@gmail.com" | |
git config --global user.name "Not-Sahil-Raja" | |
git rm --cached ScreenShots/Scores/best_model.keras | |
git rm --cached ScreenShots/Scores/model.h5 | |
git rm --cached ScreenShots/Scores/my_model.keras | |
git rm --cached model/model.h5 | |
git commit -m "Remove large files before push" | |
- 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 |