Skip to content

Commit

Permalink
Create action
Browse files Browse the repository at this point in the history
  • Loading branch information
mrfussion committed Aug 30, 2024
1 parent 7c4d818 commit 59a4fff
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 47 deletions.
47 changes: 0 additions & 47 deletions .github/worflows/create_test_env.yaml

This file was deleted.

31 changes: 31 additions & 0 deletions .github/workflows/create_test_env.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
---
name: Create test environment from PR comment

on:
issue_comment:
types: [created]

jobs:
execute_script:
runs-on: ubuntu-latest
environment: DEV

steps:
- name: Extract and set branch variable from comment
if: contains(github.event.comment.body, 'create testenv ') && github.event.comment.body != 'create testenv'
run: |
echo "branch=$(echo '${{ github.event.comment.body }}' | grep -oP '(?<=create testenv ).*')" >> $GITHUB_ENV
- name: Execute Script on Remote Server
if: ${{ env.branch != '' }}
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.TEST_ENV_SSH_HOST }}
username: ${{ secrets.TEST_ENV_SSH_USER }}
key: ${{ secrets.TEST_ENV_SSH_KEY }}
script: |
ssh-agent
ssh-add ~/.ssh/actions_keys/actions@assek
ssh-add -l
BRANCH=${{ env.branch }}
echo ${{ secrets.TEST_ENV_SUDO_PWD }} | sudo -S -E /srv/anet_testing/odoo/tools/test_environment/deploy.sh create $BRANCH

0 comments on commit 59a4fff

Please sign in to comment.