Skip to content

Update test-automation.yml #14

Update test-automation.yml

Update test-automation.yml #14

name: CI Pipeline
on:
push:
branches-ignore:
- '*'
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Build the project
run: echo "Building the project"
test:
runs-on: ubuntu-latest
environment: test
env:
GIT_STRATEGY: none
CLONE_DIR: "~/pw/auto"
GITLAB_REPO_URL: "https://jyotipmikkilineni:${{ secrets.PAT_TOKEN }}@github.com/jyotipmikkilineni/Fim_C_Automation_Repo.git"
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Setup SSH Key
run: |
echo "${{ secrets.SSH_KEY }}" > ssh_key
chmod 400 ssh_key
eval "$(ssh-agent -s)"
ssh-add ssh_key
- name: Update Git remote URL
run: |
git remote set-url origin $GITLAB_REPO_URL
- name: Deploy to TEST
run: |
echo "Deploying to TEST..."
ssh -v -o StrictHostKeyChecking=no -i ssh_key jyoti.mikkilineni@10.203.111.204 << 'EOF'
pip install pytest pytest-html geopandas rm -rf $CLONE_DIR mkdir -p $CLONE_DIR git clone -b $GITHUB_REF_NAME --single-branch $GITLAB_REPO_URL $CLONE_DIR
cd $CLONE_DIR git checkout $GITHUB_REF_NAME ~/.local/bin/pytest ~/pw/auto/scripts/tests -s git add report.html git commit -m 'Adding report to the repo'
git config --global push.default matching git push
EOF
echo "Deployed to TEST"