-
Notifications
You must be signed in to change notification settings - Fork 34
30 lines (28 loc) · 1.02 KB
/
production.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
name: Production
on:
pull_request:
branches:
- chore/release*
types:
- closed
workflow_dispatch:
jobs:
deploy:
if: ${{github.event_name == 'workflow_dispatch' || ( github.event.pull_request.merged == true && startsWith(github.head_ref, 'chore/release' ))}}
environment: production
runs-on: [self-hosted, ors-map-client-production]
steps:
- name: trigger branch name
run: echo ${GITHUB_REF_NAME}
- name: fetch repo state and prune remotes
working-directory: ${{ secrets.work_dir }}
run: git fetch --prune
- name: checkout trigger branch
working-directory: ${{ secrets.work_dir }}
run: git checkout --progress --force ${GITHUB_REF_NAME}
- name: hard reset to origin state
working-directory: ${{ secrets.work_dir }}
run: git reset --hard origin/${GITHUB_REF_NAME}
- name: build docker rebuild and restart
working-directory: ${{ secrets.work_dir }}
run: docker-compose up --build --force-recreate -d