Update .gitea/workflows/dev-docker.yml
This commit is contained in:
parent
7e2664083e
commit
d06cac6f3d
@ -1,9 +1,9 @@
|
||||
name: NodBot PE Dockerization
|
||||
name: NodBot Production Dockerization
|
||||
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- 'v*-dev*'
|
||||
- 'v*-prod*'
|
||||
|
||||
env:
|
||||
DHUB_UNAME: ${{ secrets.DHUB_UNAME }}
|
||||
@ -15,32 +15,31 @@ jobs:
|
||||
steps:
|
||||
- name: Pull latest from Git
|
||||
run: |
|
||||
echo "Branch: ${{ gitea.ref_name }}"
|
||||
echo "Branch: tags/${{ gitea.ref_name }}"
|
||||
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-dev
|
||||
cd nodbot-dev
|
||||
git clone https://git.vfsh.dev/voidf1sh/nodbot
|
||||
cd nodbot
|
||||
else
|
||||
cd nodbot-dev
|
||||
git checkout main
|
||||
cd nodbot
|
||||
git pull
|
||||
fi
|
||||
git checkout ${{ gitea.ref_name }}
|
||||
git checkout tags/${{ gitea.ref_name }}
|
||||
- name: Build the Docker image
|
||||
run: |
|
||||
cd /var/lib/act_runner/nodbot-dev
|
||||
docker build . --file Dockerfile --tag v0idf1sh/nodbot-dev
|
||||
cd /var/lib/act_runner/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 /var/lib/act_runner/nodbot-dev
|
||||
docker push v0idf1sh/nodbot-dev
|
||||
cd /var/lib/act_runner/nodbot
|
||||
docker push v0idf1sh/nodbot
|
||||
- name: Restart the container
|
||||
run: |
|
||||
cd /srv/docker/nodbot-dev
|
||||
cd /srv/docker/nodbot
|
||||
docker-compose down
|
||||
docker-compose up -d
|
Loading…
Reference in New Issue
Block a user