nodbot/.gitea/workflows/pe-docker.yml

48 lines
1.1 KiB
YAML
Raw Normal View History

2024-09-22 22:24:51 +00:00
name: NodBot PE Dockerization
on:
push:
branches:
2024-09-22 22:47:59 +00:00
- pe
2024-09-22 22:24:51 +00:00
env:
DHUB_UNAME: ${{ secrets.DHUB_UNAME }}
DHUB_PWORD: ${{ secrets.DHUB_PWORD }}
jobs:
build:
2024-09-22 22:48:35 +00:00
runs-on: self-hosted
2024-09-22 22:24:51 +00:00
steps:
- name: Pull latest from Git
run: |
2024-09-22 23:02:36 +00:00
echo "${{ gitea }}"
2024-09-22 22:24:51 +00:00
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