-
Notifications
You must be signed in to change notification settings - Fork 0
52 lines (42 loc) · 1.11 KB
/
services_pipeline.yml
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
name: Deploy Service
on:
workflow_call:
secrets:
RUNNERS:
required: true
jobs:
services:
runs-on: self-hosted
permissions: write-all
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Download Environment Artifact
uses: actions/download-artifact@master
with:
name: environment_file
path: .
- name: Set Environment Variables
id: env_vars
run: |
cat ./.env >> $GITHUB_ENV
source ./.env
- name: Cleanup Artifacts
id: cleanup
uses: geekyeggo/delete-artifact@v2
with:
name: environment_file
- name: Pull Image
id: pull_image
run: docker compose pull
- name: Build Image
id: build_image
run: docker compose build
- name: Bring Down Services
id: services_down
run: docker compose down || echo "Services Appear to be Down Already"
- name: Bring Up Services
id: services_up
run: |
echo "Running ${{ secrets.RUNNERS }} instances"
docker compose up --build --scale runner=${{ secrets.RUNNERS }} -d