diff --git a/.github/workflows/pe-docker.yml b/.github/workflows/pe-docker.yml index 003f963..d52bcfe 100644 --- a/.github/workflows/pe-docker.yml +++ b/.github/workflows/pe-docker.yml @@ -1,9 +1,9 @@ -name: NodBot Production Dockerization +name: NodBot PE Dockerization on: - commit: + push: branches: - - pe + - main env: DHUB_UNAME: ${{ secrets.DHUB_UNAME }} @@ -13,23 +13,35 @@ jobs: build: - runs-on: self-hosted + runs-on: ubuntu-latest steps: - name: Pull latest from Git run: | pwd whoami - cd /root/nodbot - git pull - git checkout pe + mkdir -p /var/lib/act_runner/ + cd /var/lib/act_runner/ + if [ ! -d "nodbot" ]; then + git clone https://git.vfsh.dev/voidf1sh/nodbot + cd nodbot + else + cd nodbot + git pull + fi + git checkout ${{ gitea.ref}} - name: Build the Docker image run: | - cd /root/nodbot + cd /var/lib/act_runner/nodbot docker build . --file Dockerfile --tag v0idf1sh/nodbot-pe - name: Log into Docker Hub run: docker login -u $DHUB_UNAME -p $DHUB_PWORD - name: Push image to Docker Hub run: | - cd /root/nodbot - docker push v0idf1sh/nodbot-pe \ No newline at end of file + cd /var/lib/act_runner/nodbot + docker push v0idf1sh/nodbot-pe + - name: Restart the container + run: | + cd /srv/docker/nodbot-pe + docker-compose down + docker-compose up -d \ No newline at end of file