Skip to content

Commit a09a97f

Browse files
committed
adding container & services to the workflow
1 parent 5e5619e commit a09a97f

1 file changed

Lines changed: 48 additions & 1 deletion

File tree

.github/workflows/deployment.yml

Lines changed: 48 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,32 @@ jobs:
6868
- dotnet-version: "8.0.x"
6969
operating-system: "windows-latest"
7070
runs-on: ${{ matrix.operating-system }}
71+
container:
72+
image: mcr.microsoft.com/dotnet/aspnet:10.0
73+
7174
environment: staging
72-
75+
services:
76+
sql:
77+
image: mcr.microsoft.com/mssql/server:2022-latest
78+
ports:
79+
- "${SQL_PORT}:1433"
80+
env:
81+
ACCEPT_EULA: "Y"
82+
MSSQL_SA_PASSWORD: "${SQL_PASSWORD}"
83+
volumes:
84+
- sql-data:/var/opt/mssql
85+
86+
redis:
87+
image: redis:7
88+
ports:
89+
- '${REDIS_PORT}:6379'
90+
volumes:
91+
- redis-data:/data
92+
command: >
93+
redis-server
94+
--requirepass ${REDIS_PASSWORD}
95+
--appendonly yes
96+
7397
steps:
7498
- name: Get Code
7599
uses: actions/checkout@v4
@@ -98,6 +122,29 @@ jobs:
98122
operating-system: "windows-latest"
99123

100124
runs-on: ${{ matrix.operating-system }}
125+
container:
126+
image: mcr.microsoft.com/dotnet/aspnet:10.0
127+
services:
128+
sql:
129+
image: mcr.microsoft.com/mssql/server:2022-latest
130+
ports:
131+
- "${SQL_PORT}:1433"
132+
env:
133+
ACCEPT_EULA: "Y"
134+
MSSQL_SA_PASSWORD: "${SQL_PASSWORD}"
135+
volumes:
136+
- sql-data:/var/opt/mssql
137+
138+
redis:
139+
image: redis:7
140+
ports:
141+
- '${REDIS_PORT}:6379'
142+
volumes:
143+
- redis-data:/data
144+
command: >
145+
redis-server
146+
--requirepass ${REDIS_PASSWORD}
147+
--appendonly yes
101148
environment: production
102149
outputs:
103150
random-number: ${{ steps.publish.outputs.random-num }}

0 commit comments

Comments
 (0)