From 8f7ed605a4ab14f1da5020d1e73ce6be479d179e Mon Sep 17 00:00:00 2001 From: Skylar Grant Date: Sun, 22 Sep 2024 22:26:09 +0000 Subject: [PATCH 1/2] Update .github/workflows/pe-docker.yml Match from pe branch --- .github/workflows/pe-docker.yml | 32 ++++++++++++++++++++++---------- 1 file changed, 22 insertions(+), 10 deletions(-) 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 From 38d90d7f6bb842f109a7ac609075eadd1be9ec4f Mon Sep 17 00:00:00 2001 From: Skylar Grant Date: Sun, 22 Sep 2024 18:49:27 -0400 Subject: [PATCH 2/2] Update CI/CD --- {.github => .gitea}/workflows/pe-docker.yml | 4 ++-- {.github => .gitea}/workflows/production-docker.yml | 0 2 files changed, 2 insertions(+), 2 deletions(-) rename {.github => .gitea}/workflows/pe-docker.yml (96%) rename {.github => .gitea}/workflows/production-docker.yml (100%) diff --git a/.github/workflows/pe-docker.yml b/.gitea/workflows/pe-docker.yml similarity index 96% rename from .github/workflows/pe-docker.yml rename to .gitea/workflows/pe-docker.yml index d52bcfe..179d2e7 100644 --- a/.github/workflows/pe-docker.yml +++ b/.gitea/workflows/pe-docker.yml @@ -3,7 +3,7 @@ name: NodBot PE Dockerization on: push: branches: - - main + - pe env: DHUB_UNAME: ${{ secrets.DHUB_UNAME }} @@ -13,7 +13,7 @@ jobs: build: - runs-on: ubuntu-latest + runs-on: self-hosted steps: - name: Pull latest from Git diff --git a/.github/workflows/production-docker.yml b/.gitea/workflows/production-docker.yml similarity index 100% rename from .github/workflows/production-docker.yml rename to .gitea/workflows/production-docker.yml