CD Pipeline #98
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CD Pipeline | |
on: | |
workflow_run: | |
workflows: ["CI Pipeline"] | |
branches: [main] | |
types: | |
- completed | |
jobs: | |
on-success: | |
runs-on: self-hosted | |
if: ${{ github.event.workflow_run.conclusion == 'success' }} | |
steps: | |
- name: Pull Docker image | |
run: sudo docker pull demonstrationorg/juvenile:main | |
- name: Delete old docker container | |
run: sudo docker rm -f juvenile || true | |
- name: Run Docker Container | |
run: | | |
sudo docker run -d -p 3000:3000 --name juvenile demonstrationorg/juvenile:main | |
on-failure: | |
runs-on: ubuntu-latest | |
if: ${{ github.event.workflow_run.conclusion == 'failure' }} | |
steps: | |
- run: echo 'The triggering workflow failed' |