Skip to content

Commit

Permalink
Merge pull request #1 from zsquare12/contrz
Browse files Browse the repository at this point in the history
Contrz deployment pipeline set
  • Loading branch information
jitendra-ky authored Sep 1, 2024
2 parents 32ae746 + 5a61c06 commit 4b3fb5e
Show file tree
Hide file tree
Showing 4 changed files with 86 additions and 3 deletions.
6 changes: 6 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.venv
.env
test.ipynb
text.py
.git
.gitignore
57 changes: 57 additions & 0 deletions .github/workflows/cd-pineline.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: Build, Push Docker Image, Deploy, and Restart

on:
push:
branches:
- main # Triggers on changes to the main branch

jobs:
build-and-push:
runs-on: ubuntu-latest

steps:
# Step 1: Checkout the repository
- name: Checkout repository
uses: actions/checkout@v3

# Step 2: Set up Docker Buildx for building images
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

# Step 3: Log in to Docker Hub using credentials stored in GitHub secrets
- name: Log in to Docker Hub
uses: docker/login-action@v2
with:
username: jitenky
password: ${{ secrets.DOKER_TOKEN }}

# Step 4: Build and tag the Docker image
- name: Build and tag Docker image
run: |
docker build -t jitenky/stapp3906:latest .
# Step 5: Push the Docker image to Docker Hub
- name: Push Docker image to Docker Hub
run: |
docker push jitenky/stapp3906:latest
restart:
permissions:
id-token: write
contents: none
runs-on: ubuntu-latest
needs: build-and-push
steps:
# Step 1: Log in to Azure CLI
- name: Login to Azure CLI
uses: azure/login@v2
with:
creds: ${{ secrets.AZURE_CREDENTIALS }} # This should be a JSON object containing your credentials

# Step 2: Restart the Azure Web App
- name: Restart Azure Web App
uses: azure/cli@v2
with:
azcliversion: latest
inlineScript: |
az webapp restart --name st-sih-1134 --resource-group sih-ps
20 changes: 20 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Use an official Python runtime as a parent image
FROM python:3.12-slim

# Set the working directory in the container
WORKDIR /app

# Copy the requirements.txt file into the container at /app
COPY requirements.txt .

# Install any dependencies specified in requirements.txt
RUN pip install --no-cache-dir -r requirements.txt

# Copy the rest of the application code to /app
COPY . .

# Expose port 8000, as required by Azure App Service
EXPOSE 8000

# Command to run the Streamlit app, configured to use port 8000
CMD ["streamlit", "run", "app.py", "--server.port=8000", "--server.address=0.0.0.0"]
6 changes: 3 additions & 3 deletions app.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@

# set page config
st.set_page_config(
page_title="Resume ATS Tracker",
page_icon="🧊",
page_title="CareerCraft",
page_icon="📃",
layout="wide",
)
st.title("🧊 CareerCraft")
st.title("📃 CareerCraft")

# Display a message with a LinkedIn profile link
st.write("Developed by [Jitendra-Kumar](https://www.linkedin.com/in/jitendra-ky)")
Expand Down

0 comments on commit 4b3fb5e

Please sign in to comment.