Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test #87

Closed
wants to merge 1 commit into from
Closed

test #87

Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
67 changes: 67 additions & 0 deletions .github/workflows/test_release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: release

on:
push:
branches:
- develop
- main
pull_request:

jobs:
deploy-service-on-propel:
name: Deploy service on propel
environment: 'production'
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
python-version: ["3.10"]
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 propel-client open-autonomy

- name: Make use proxy instead of actual nlb by dns override
run: |
# for staging
export IP_ADDR=$(dig +short balancer.tcp.propel.staging.autonolas.tech)
echo -e "\n$IP_ADDR\tapp.propel.staging.valory.xyz\n" | sudo tee -a /etc/hosts

# for prod
export IP_ADDR=$(dig +short balancer.tcp.propel.autonolas.tech)
echo -e "\n$IP_ADDR\tapp.propel.valory.xyz\n" | sudo tee -a /etc/hosts

- name: Login to propel
run: |
$CMD login -u '${{ vars.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 "GET ENV VARS from secret"
echo '${{ toJSON(secrets) }}' | jq -r 'to_entries|map("export \(.key)=\(.value|tojson)")|.[]' > github.vars
echo >> github.vars
echo "GET ENV VARS from vars"
echo '${{ toJSON(vars) }}' | jq -r 'to_entries|map("export \(.key)=\(.value|tojson)")|.[]' >> github.vars
echo "GET ENV VARS done"
source github.vars
echo "GET ENV VARS load"
$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
Loading