SANDRAMSC's picture
Added ci-cd.yml top workflow directory
c39ce8e
raw
history blame
1.27 kB
name: Build and Publish Docker Image to DockerHub
on:
push:
branches: ["main"]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: 3.9
- name: Install dependencies
run: pip install -r requirements.txt
deploy:
runs-on: ubuntu-latest
needs: build
if: success()
steps:
- name: Build and Push Docker Image
run: |
docker build -t ${{ secrets.DOCKERHUB_USERNAME }}/dockerverifyrag:latest .
docker login -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKER_PASSWORD }}
docker push ${{ secrets.DOCKERHUB_USERNAME }}/dockverifyrag:latest
update-readme:
runs-on: ubuntu-latest
needs: build
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Update README
run: |
git config --global user.email "actions@github.com"
git config --global user.name "GitHub Actions"
git add .
git commit -m "README.md has been updated"
git push