Update CI/CD for testing
This commit is contained in:
parent
3be90aef30
commit
e0805c0241
47
.gitea/workflows/pe-docker.yml
Normal file
47
.gitea/workflows/pe-docker.yml
Normal file
@ -0,0 +1,47 @@
|
||||
name: NodBot PE Dockerization
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
|
||||
env:
|
||||
DHUB_UNAME: ${{ secrets.DHUB_UNAME }}
|
||||
DHUB_PWORD: ${{ secrets.DHUB_PWORD }}
|
||||
|
||||
jobs:
|
||||
|
||||
build:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Pull latest from Git
|
||||
run: |
|
||||
pwd
|
||||
whoami
|
||||
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 /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 /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
|
35
.github/workflows/pe-docker.yml
vendored
35
.github/workflows/pe-docker.yml
vendored
@ -1,35 +0,0 @@
|
||||
name: NodBot Production Dockerization
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- pe
|
||||
|
||||
env:
|
||||
DHUB_UNAME: ${{ secrets.DHUB_UNAME }}
|
||||
DHUB_PWORD: ${{ secrets.DHUB_PWORD }}
|
||||
|
||||
jobs:
|
||||
|
||||
build:
|
||||
|
||||
runs-on: self-hosted
|
||||
|
||||
steps:
|
||||
- name: Pull latest from Git
|
||||
run: |
|
||||
pwd
|
||||
whoami
|
||||
cd /root/nodbot
|
||||
git pull
|
||||
git checkout pe
|
||||
- name: Build the Docker image
|
||||
run: |
|
||||
cd /root/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
|
35
.github/workflows/production-docker.yml
vendored
35
.github/workflows/production-docker.yml
vendored
@ -1,35 +0,0 @@
|
||||
name: NodBot Production Dockerization
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches:
|
||||
- main
|
||||
|
||||
env:
|
||||
DHUB_UNAME: ${{ secrets.DHUB_UNAME }}
|
||||
DHUB_PWORD: ${{ secrets.DHUB_PWORD }}
|
||||
|
||||
jobs:
|
||||
|
||||
build:
|
||||
|
||||
runs-on: self-hosted
|
||||
|
||||
steps:
|
||||
- name: Pull latest from Git
|
||||
run: |
|
||||
pwd
|
||||
whoami
|
||||
cd /root/nodbot
|
||||
git pull
|
||||
git checkout $GITHUB_HEAD_REF
|
||||
- name: Build the Docker image
|
||||
run: |
|
||||
cd /root/nodbot
|
||||
docker build . --file Dockerfile --tag v0idf1sh/nodbot
|
||||
- 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
|
Loading…
Reference in New Issue
Block a user