Skip to content

.github/workflows/new_container.yml #27

.github/workflows/new_container.yml

.github/workflows/new_container.yml #27

Workflow file for this run

name: Pull New Image & Restart Container
on:
workflow_run:
workflows: ["Build and Publish", "Build and Publish - Dev Build"]
types:
- completed
jobs:
check_workflow:
runs-on: ubuntu-latest
outputs:
is_dev: ${{ steps.check_dev.outputs.is_dev }}
steps:
- name: Check which workflow was run
id: check_dev
run: echo "::set-output name=is_dev::${{ github.event.workflow_run.name == 'Build and Publish - Dev Build' }}"
deploy:
needs: check_workflow
runs-on: ubuntu-latest
steps:
- name: Execute SSH commands on remote server for Prod
if: needs.check_workflow.outputs.is_dev == 'false'
uses: JimCronqvist/action-ssh@master
with:
hosts: ${{ secrets.HOST }}
privateKey: ${{ secrets.PRIVATE_KEY }}
command: docker pull strayingfromthepath/xenosaga && docker restart xenosaga
- name: Execute SSH commands on remote server for Dev
if: needs.check_workflow.outputs.is_dev == 'true'
uses: JimCronqvist/action-ssh@master
with:
hosts: ${{ secrets.HOST }}
privateKey: ${{ secrets.PRIVATE_KEY }}
command: docker pull strayingfromthepath/xenosaga:dev && docker restart xenosaga-dev