Skip to content

Create github workflow to deploy #1

Create github workflow to deploy

Create github workflow to deploy #1

Workflow file for this run

name: Deploy demo

Check failure on line 1 in .github/workflows/deploy-demo.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/deploy-demo.yml

Invalid workflow file

No steps defined in `steps` and no workflow called in `uses` for the following jobs: deploy-demo
on:
workflow_dispatch:
jobs:
deploy-demo:
name: Deploy demo
if: |
always() &&
(needs.tests.result == 'success' || needs.tests.result == 'skipped')
env:
BRANCH: ${{ format('origin/{0}', github.ref_name) }}
PRIVATE_KEY: ${{ secrets.AWS_DEPLOY_KEY }}
HOSTNAME : ${{ secrets.AWS_HOSTNAME }}
USER_NAME : ${{ secrets.AWS_USER }}
run: |
echo "$PRIVATE_KEY" > private_key && chmod 600 private_key
ssh -o StrictHostKeyChecking=no -i private_key ${USER_NAME}@${HOSTNAME} "
cd /home/ubuntu/ &&
[ -d gally ] || git clone https://github.com/Elastic-Suite/sylius-demo.git gally &&
cd /home/ubuntu/sylius &&
docker system prune -af &&
([[ $(docker volume ls -q | awk '!/_/' | tr '\n' ' ' | wc -l) -eq 0 ]] || docker volume rm $(docker volume ls -q | awk '!/_/' | tr '\n' ' ')) &&
docker compose down &&
git fetch --all && git reset --hard && git checkout ${{ env.BRANCH }} &&
docker compose -f docker-compose.yml -f docker-compose.int.yml up -d --build
"