Compare commits
2 Commits
65470f2c57
...
9d9a1447f3
Author | SHA1 | Date | |
---|---|---|---|
9d9a1447f3 | |||
70fc12d458 |
@ -10,14 +10,12 @@ env:
|
||||
DHUB_PWORD: ${{ secrets.DHUB_PWORD }}
|
||||
|
||||
jobs:
|
||||
|
||||
build:
|
||||
|
||||
runs-on: self-hosted
|
||||
|
||||
steps:
|
||||
- name: Pull latest from Git
|
||||
run: |
|
||||
echo "Branch: ${{ gitea.head_ref }}"
|
||||
pwd
|
||||
whoami
|
||||
mkdir -p /var/lib/act_runner/
|
||||
@ -29,7 +27,7 @@ jobs:
|
||||
cd nodbot
|
||||
git pull
|
||||
fi
|
||||
git checkout ${{ gitea.ref}}
|
||||
git checkout ${{ gitea.head_ref }}
|
||||
- name: Build the Docker image
|
||||
run: |
|
||||
cd /var/lib/act_runner/nodbot
|
||||
|
@ -10,26 +10,36 @@ env:
|
||||
DHUB_PWORD: ${{ secrets.DHUB_PWORD }}
|
||||
|
||||
jobs:
|
||||
|
||||
build:
|
||||
|
||||
runs-on: self-hosted
|
||||
|
||||
steps:
|
||||
- name: Pull latest from Git
|
||||
run: |
|
||||
echo "Branch: ${{ gitea.head_ref }}"
|
||||
pwd
|
||||
whoami
|
||||
cd /root/nodbot
|
||||
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
|
||||
git checkout $GITHUB_HEAD_REF
|
||||
fi
|
||||
git checkout ${{ gitea.head_ref }}
|
||||
- name: Build the Docker image
|
||||
run: |
|
||||
cd /root/nodbot
|
||||
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 /root/nodbot
|
||||
cd /var/lib/act_runner/nodbot
|
||||
docker push v0idf1sh/nodbot
|
||||
- name: Restart the container
|
||||
run: |
|
||||
cd /srv/docker/nodbot
|
||||
docker-compose down
|
||||
docker-compose up -d
|
Loading…
Reference in New Issue
Block a user