Skip to content

[WIP] propel deploy ci integration #8

[WIP] propel deploy ci integration

[WIP] propel deploy ci integration #8

Workflow file for this run

name: Release Flow
on:
push:
branches:
- develop
- main
pull_request:
jobs:
deploy-service-on-propel:
name: Deploy service on propel
# needs:
# - "publish-packages"
# - "publish-images"
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
python-version: ["3.11"]
env:
CMD: "propel -U ${{ vars.PROPEL_BASE_URL }}"
steps:
- uses: actions/checkout@master
- uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-versions }}
- name: Install dependencies
run: |
sudo apt-get update --fix-missing
sudo apt-get autoremove
sudo apt-get autoclean
python -m pip install --upgrade pip
pip install git+https://github.com/valory-xyz/propel-client.git@feature/service-deploy open-autonomy
- name: Login to propel
run: |
$CMD login -u ${{ secrets.PROPEL_USERNAME }} -p ${{ secrets.PROPEL_PASSWORD }}
- name: Do a deployment
run: |
# determine ipfs hash id
export IPFS_HASH=$(jq '.dev | to_entries[] | select(.key | startswith("service"))| .value' -r ./packages/packages.json | head -n1)
export SERVICE_PATH=service_for_propel
# fetch service file and check it published
autonomy init --reset --author ci --ipfs --remote
autonomy fetch $IPFS_HASH --service --alias $SERVICE_PATH
# get env vars from github actions
echo '${{ toJSON(secrets) }}' | jq -r 'to_entries|map("export \(.key)=\(.value|tojson)")|.[]' > github.vars
source github.vars
# make service deployment with env var as source of variables
$CMD service deploy --name ${{ vars.SERVICE_NAME }} --service-dir $SERVICE_PATH --service-ipfs-hash $IPFS_HASH --ingress-enabled true --keys ${{ vars.SERVICE_KEYS }} --timeout 320