Skip to content

Stage Release

Stage Release #17

Workflow file for this run

---
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
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