forked from GDSC-CAU/PuangFilm-BE
-
Notifications
You must be signed in to change notification settings - Fork 0
35 lines (27 loc) · 820 Bytes
/
CD.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
name: CD
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
types: [closed]
workflow_dispatch:
permissions:
contents: read
jobs:
deploy:
if: github.event.pull_request.merged == true
runs-on: self-hosted
steps:
- uses: actions/checkout@v4
- name: Docker Login
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
- name: Pull Docker Image
run: sudo docker pull ${{ secrets.DOCKERHUB_USERNAME }}/puang
- name: Remove Old Docker Container
run: sudo docker rm -f puang || true
- name: Run Updated Docker Container
run: sudo docker run -t -d --name puang -p 8080:8080 ${{ secrets.DOCKERHUB_USERNAME }}/puang