File tree Expand file tree Collapse file tree 1 file changed +3
-27
lines changed Expand file tree Collapse file tree 1 file changed +3
-27
lines changed Original file line number Diff line number Diff line change 1- name : CI/CD Pipeline
1+ name : CI Pipeline
22
33on :
44 push :
99 - main
1010
1111jobs :
12- build :
12+ test :
1313 runs-on : ubuntu-latest
1414
1515 steps :
1919 - name : Set up Python
2020 uses : actions/setup-python@v2
2121 with :
22- python-version : " 3.10.11 "
22+ python-version : " 3.8 " # Specify the Python version you need
2323
2424 - name : Install dependencies
2525 run : |
3030 run : |
3131 # You can use pytest or any other testing framework
3232 pytest
33-
34- deploy :
35- runs-on : windows-latest
36- needs : build
37- if : github.ref == 'refs/heads/main' # Deploy only from the main branch
38-
39- steps :
40- - name : Checkout code
41- uses : actions/checkout@v2
42-
43- - name : Deploy to Windows Server
44- run : |
45- echo "Deploying to the Windows server..."
46- # Replace the following command with your deployment script
47- # Example: Using PowerShell to invoke a deployment script
48- $session = New-PSSession -ComputerName your_server -Credential (Get-Credential)
49- Invoke-Command -Session $session -ScriptBlock {
50- cd "C:\path\to\your\app"
51- git pull
52- # Optionally restart your Flask service or application
53- Stop-Service -Name "your_flask_service" -Force
54- Start-Service -Name "your_flask_service"
55- }
56- Remove-PSSession -Session $session
You can’t perform that action at this time.
0 commit comments