-
Notifications
You must be signed in to change notification settings - Fork 1
79 lines (66 loc) · 2.38 KB
/
release.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
---
name: Stage Release
env:
LC_ALL: "C.UTF-8" # prevent ERROR: Ansible could not initialize the preferred locale: unsupported locale setting
on:
workflow_dispatch:
inputs:
version:
description: 'Ascender Ledger version.'
required: true
default: ''
confirm:
description: 'Are you sure? Set this to yes.'
required: true
default: 'no'
jobs:
stage:
if: endsWith(github.repository, '/ascender-ledger')
runs-on: ubuntu-latest
permissions:
packages: write
contents: write
steps:
- name: Verify inputs
run: |
set -e
if [[ ${{ github.event.inputs.confirm }} != "yes" ]]; then
>&2 echo "Confirm must be 'yes'"
exit 1
fi
if [[ ${{ github.event.inputs.version }} == "" ]]; then
>&2 echo "Set version to continue."
exit 1
fi
exit 0
- name: Install python ${{ env.py_version }}
uses: actions/setup-python@v2
with:
python-version: ${{ env.py_version }}
- name: Checkout ascender ledger
uses: actions/checkout@v2
with:
path: ascender-ledger
ref: main
- name: Get python version from Makefile
run: echo py_version=`make PYTHON_VERSION` >> $GITHUB_ENV
- name: Install playbook dependencies
run: |
python3 -m pip install docker==6.1.3
python3 -m pip install docker-compose
- name: Log in to GHCR
run: |
echo ${{ secrets.GITHUB_TOKEN }} | docker login ghcr.io -u ${{ github.actor }} --password-stdin
- name: Build Ascender Ledger
working-directory: ascender-ledger
run: |
docker-compose build
- name: Push Ascender Ledger
working-directory: ascender-ledger
run: |
docker image push ghcr.io/${{ github.repository }}/ledger-web:${{ github.event.inputs.version }}
docker image push ghcr.io/${{ github.repository }}/ledger-parser:${{ github.event.inputs.version }}
docker image push ghcr.io/${{ github.repository }}/ledger-db:${{ github.event.inputs.version }}
docker image push ghcr.io/${{ github.repository }}/ledger-web:latest
docker image push ghcr.io/${{ github.repository }}/ledger-parser:latest
docker image push ghcr.io/${{ github.repository }}/ledger-db:latest