Delete .git.bfg-report directory #70
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: Continuous Deployment | |
on: | |
push: | |
branches: [ develop ] # Change this to the branch you want to trigger the workflow | |
workflow_dispatch: | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Set up Python 3.11 | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.11' | |
- name: Update pipenv | |
run: | | |
python -m pip install --upgrade pip pipenv | |
- name: Install dependencies from requirements.txt | |
run: | | |
if [ -f requirements.txt ]; then | |
python -m pip install --upgrade pip | |
pip install -r requirements.txt | |
fi | |
- name: Install pipenv and dependencies | |
run: | | |
python -m pip install --upgrade pip pipenv | |
if [ -f Pipfile ]; then | |
pipenv install --dev --skip-lock | |
fi | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Cache Docker layers | |
uses: actions/cache@v3 | |
with: | |
path: | | |
~/.docker | |
/tmp/.buildx-cache | |
key: ${{ runner.os }}-docker-${{ github.sha }} | |
restore-keys: | | |
${{ runner.os }}-docker- | |
- name: Build Docker image | |
run: | | |
docker build -t my-app:latest . | |
- name: Log in to Docker Hub | |
uses: docker/login-action@v2 | |
with: | |
username: ${{ secrets.DOCKER_HUB_USERNAME }} | |
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} | |
- name: Tag Docker image | |
run: | | |
docker tag my-app:latest ${{ secrets.DOCKER_HUB_USERNAME }}/my-app:latest | |
- name: Push Docker image to Docker Hub | |
run: | | |
docker push ${{ secrets.DOCKER_HUB_USERNAME }}/my-app:latest | |
- name: Clean up Docker images | |
run: | | |
docker rmi my-app:latest |