generated from wuespace/telestion-project-template
-
Notifications
You must be signed in to change notification settings - Fork 0
66 lines (57 loc) · 2.18 KB
/
publish-setup.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
name: Publish setup
# Events that trigger this workflow
on:
workflow_run:
workflows: ["Release"]
types: [completed]
jobs:
publish-setup:
name: Publish setup and configuration scripts
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'success' }}
steps:
- name: Checkout 📥
uses: actions/[email protected]
with:
submodules: true
- name: Download build environment 📥
uses: dawidd6/[email protected]
with:
workflow: ${{ github.event.workflow_run.workflow_id }}
workflow_conclusion: success
name: build-env
path: ${{ github.workspace }}
- name: Import environment ⛓
shell: bash
run: cat "${GITHUB_WORKSPACE}/.build-env" >> $GITHUB_ENV
- name: Fail on skipped release
run: test "$SKIPPED" = "false"
env:
SKIPPED: ${{ env.skipped }}
- name: Tag docker image in compose file
run: |
sed -i "s/${PLACEHOLDER}/${REPLACE_WITH}/g" application/production.yml
env:
PLACEHOLDER: "##TAG##"
REPLACE_WITH: ${{ env.version }}
- name: Copy required components ✂️
run: |
mkdir -p "${TEMP_DIR}/${BUILD_DIR}"
cp -r application/{conf,data,production.yml} "${TEMP_DIR}/${BUILD_DIR}/"
mv "${TEMP_DIR}/${BUILD_DIR}/production.yml" "${TEMP_DIR}/${BUILD_DIR}/docker-compose.yml"
env:
TEMP_DIR: ${{ runner.temp }}
BUILD_DIR: telestion-project-daedalus2-docker-compose-${{ env.version }}
- name: Compress production workspace 📦
working-directory: ${{ runner.temp }}
run: zip -r "${BUILD_DIR}.zip" "${BUILD_DIR}"
env:
TEMP_DIR: ${{ runner.temp }}
BUILD_DIR: telestion-project-daedalus2-docker-compose-${{ env.version }}
- name: Upload release workspace 🪡
if: ${{ env.skipped == 'false' }}
uses: svenstaro/[email protected]
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ env.tag }}
file: ${{ runner.temp }}/telestion-project-daedalus2-docker-compose-${{ env.version }}.zip