-
Notifications
You must be signed in to change notification settings - Fork 0
144 lines (112 loc) · 4.51 KB
/
workflow.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
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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
name: CI Workflow
on:
push:
branches: [ "main" ]
paths-ignore: ["**/*.md"]
pull_request:
branches: [ "main" ]
paths-ignore: ["**/*.md"]
workflow_dispatch:
jobs:
# build:
# runs-on: ubuntu-24.04
# steps:
# - uses: actions/checkout@v4
# - name: Create .env file
# run: |
# cat << EOF > .env
# POSTGRES_USER=${{ secrets.POSTGRES_USER }}
# POSTGRES_PASSWD=${{ secrets.POSTGRES_PASSWORD }}
# REDIS_PASSWD=${{ secrets.REDIS_PASSWD }}
# POSTGRES_HOST=${{ vars.POSTGRES_HOST }}
# POSTGRES_DB=${{ vars.POSTGRES_DB }}
# EOF
# - name: Build and Run
# run: |
# docker compose up -d
# docker ps
# - name: Health check
# run: |
# sleep 30
# docker ps
# docker logs app
# echo ------
# docker logs database
# curl --fail http://localhost:8000/healthz 1>&2 2>/dev/null
# test:
# runs-on: ubuntu-24.04
# needs: build
# strategy:
# # max-parallel: 3
# matrix:
# python-version: [3.9]
# steps:
# - uses: actions/checkout@v4
# - name: Set up python ${{ matrix.python-version }}
# uses: actions/setup-python@v3
# with:
# python-version: ${{ matrix.python-version }}
# - name: Install dependencies
# run: |
# cd src
# python -m pip install --upgrade pip
# pip install -r Requirements.txt
# - name: Run tests
# run: python src/manage.py test
# push_image:
# runs-on: ubuntu-24.04
# needs: test
# if: github.event_name == 'push'
# steps:
# - uses: actions/checkout@v4
# - name: Login to DockerHub
# uses: docker/login-action@v3
# with:
# username: ${{ vars.DOCKERHUB_USERNAME }}
# password: ${{ secrets.DOCKERHUB_TOKEN }}
# - name: Build
# run: docker compose build
# - name: push docker image
# run: |
# docker tag ozennou/ronda_game:latest ozennou/ronda_game:0.0.${GITHUB_RUN_NUMBER}v
# docker push ozennou/ronda_game:0.0.${GITHUB_RUN_NUMBER}v
# docker push ozennou/ronda_game:latest
deployment:
runs-on: ubuntu-24.04
# needs: push_image
steps:
- name: Workflow Dispatcher
# You may pin to the exact commit or the version.
# uses: adityakar/workflow-dispatcher@a0f690a2262373956eaee3ef74a01f5afed4ec7c
uses: adityakar/workflow-dispatcher@v1.0
with:
# Owner of the GitHub repo
owner: ozennou
# Name of the GitHub repo
repo: Ronda-deploy
# Access token (PAT) for the repo
token: ${{ secrets.G_TOKEN }}
# The event type of the repository dispatch
event_type: workflow_dispatch
# Payload for the repository dispatch event
# client_payload: # optional, default is {}
# # How long to wait between polls (seconds)
# wait_time: # optional, default is 10
# # Maximum amount of time to wait for workflow (seconds)
# max_time: # optional, default is 600
deployment2:
runs-on: ubuntu-24.04
# needs: push_image
steps:
- name: Workflow Dispatch
# You may pin to the exact commit or the version.
# uses: benc-uk/workflow-dispatch@25b02cc069be46d637e8fe2f1e8484008e9e9609
uses: benc-uk/workflow-dispatch@v1.2.3
with:
# Name, filename or ID of workflow to run
workflow: CD.yml
# GitHub token with repo write access, only required if the workflow is in a different repository
token: ${{ secrets.G_TOKEN }}
ref: main
# Repo owner & name, slash separated, only set if invoking a workflow in a different repo
repo: ozennou/Ronda-deploy