-
Notifications
You must be signed in to change notification settings - Fork 0
114 lines (94 loc) · 3.6 KB
/
push-default-and-deploy.yml
File metadata and controls
114 lines (94 loc) · 3.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
name: Push Default and Deploy
on: workflow_dispatch
# push:
# branches:
# - main
# workflow_dispatch:
permissions: # Permissions for OIDC
id-token: write
contents: read
jobs:
build-and-test:
runs-on: ubuntu-latest
steps:
- name: Before composite action
run: echo "This is a step before the composite action."
- name: Build and Test Python Project
uses: TomSmithCoding/python-build-test-custom-action@main
with:
python-version: "3.x"
output-path: "src"
- name: After composite action
run: echo "This is a step after the composite action."
deploy-mock-dev:
runs-on: ubuntu-latest
needs: build-and-test
environment:
name: DEV
#url: https://dev.example.com
steps:
- name: Download build artifacts
uses: actions/download-artifact@v4
with:
name: pythonproject-build
path: pythonproject-build
- name: Prove files are there
run: |
echo "Files in the build directory:"
ls -la
ls -la pythonproject-build
- name: Deploy to mock dev
run: |
echo "Deploying to mock server..."
# Add your deployment commands here
# For example, you can use scp or rsync to copy files to the server
# scp -r pythonproject-build/* user@mockserver:/path/to/deploy
deploy-mock-staging:
runs-on: ubuntu-latest
needs: build-and-test
environment:
name: STAGING
#url: https://staging.example.com
steps:
- name: Download build artifacts
uses: actions/download-artifact@v4
with:
name: pythonproject-build
path: pythonproject-build
- name: Prove files are there
run: |
echo "Files in the build directory:"
ls -la
ls -la pythonproject-build
- name: Deploy to mock staging
run: |
echo "Deploying to mock server..."
# Add your deployment commands here
# Login to azure step followed by Deploy to azure step
# For example, you can use scp or rsync to copy files to the server
# scp -r pythonproject-build/* user@mockserver:/path/to/deploy
deploy-mock-production:
runs-on: ubuntu-latest
needs:
- deploy-mock-dev
- deploy-mock-staging
environment:
name: PROD
#url: https://prod.example.com
steps:
- name: Download build artifacts
uses: actions/download-artifact@v4
with:
name: pythonproject-build
path: pythonproject-build
- name: Prove files are there
run: |
echo "Files in the build directory:"
ls -la
ls -la pythonproject-build
- name: Deploy to mock production
run: |
echo "Deploying to mock server..."
# Add your deployment commands here
# For example, you can use scp or rsync to copy files to the server
# scp -r pythonproject-build/* user@mockserver:/path/to/deploy