Skip to content

Commit

Permalink
Enable auto versioning for docker images
Browse files Browse the repository at this point in the history
  • Loading branch information
JackyZzZz committed Aug 31, 2024
1 parent b287ce7 commit 7dde538
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions .github/workflows/interface_auto.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
- "master"
- "main"
- "webapp"
- "jun-intro-maxmin"
- "jun-gsoc-final"
pull_request:
branches:
- "master"
Expand All @@ -33,20 +33,25 @@ jobs:
with:
python-version: 3.11

# Step 3: Build the Docker image to Docker Hub
# Step 3: Get the short Git commit hash for versioning
- name: Get short Git commit hash
id: version
run: echo "VERSION=$(git rev-parse --short HEAD)" >> $GITHUB_ENV

# Step 4: Build the Docker image and tag it with the short Git commit hash
- name: Build Docker image
run: |
docker build . -t qcdevs/selector:latest
docker build . -t qcdevs/selector:${{ env.VERSION }}
# Step 4: Push the Docker image to Docker Hub
# Step 5: Push the Docker image to Docker Hub
- name: Push Docker image
env:
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
run: |
docker login -u qcdevs -p $DOCKERHUB_TOKEN
docker push qcdevs/selector:latest
docker push qcdevs/selector:${{ env.VERSION }}
# Step 5: Replace the README.md file for Hugging Face
# Step 6: Replace the README.md file for Hugging Face
- name: Replace README for Hugging Face
run: |
mv README_hf.md README.md
Expand All @@ -55,7 +60,7 @@ jobs:
git add README.md
git commit -m "Replace README.md with README_hf.md for Hugging Face"
# Step 6: Push the app to Hugging Face
# Step 7: Push the app to Hugging Face
- name: Push to Hugging Face
env:
HF_TOKEN: ${{ secrets.HF_TOKEN }}
Expand Down

0 comments on commit 7dde538

Please sign in to comment.