Tweak dev CI to use a clean environment every time
All checks were successful
NodBot PE Dockerization / build (push) Successful in 20s
All checks were successful
NodBot PE Dockerization / build (push) Successful in 20s
This commit is contained in:
parent
efcf613ea4
commit
4fcb45823d
@ -1,10 +1,16 @@
|
||||
name: NodBot PE Dockerization
|
||||
######################################################
|
||||
# Creates a new Docker image of nodbot-dev, pushes #
|
||||
# it to DockerHub, and restarts the container. #
|
||||
######################################################
|
||||
|
||||
# Run when a new tag for dev is pushed
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- 'v*-dev*'
|
||||
|
||||
|
||||
# Pull DockerHub credentials from secrets
|
||||
env:
|
||||
DHUB_UNAME: ${{ secrets.DHUB_UNAME }}
|
||||
DHUB_PWORD: ${{ secrets.DHUB_PWORD }}
|
||||
@ -13,21 +19,17 @@ jobs:
|
||||
build:
|
||||
runs-on: self-hosted
|
||||
steps:
|
||||
- name: Clean up old environment
|
||||
run: |
|
||||
rm -rf /var/lib/act_runner/nodbot
|
||||
rm -rf /var/lib/act_runner/nodbot-dev
|
||||
- name: Pull latest from Git
|
||||
run: |
|
||||
echo "Ref: ${{ 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
|
||||
cd nodbot
|
||||
else
|
||||
cd nodbot
|
||||
git checkout main
|
||||
git pull
|
||||
fi
|
||||
cd /var/lib/act_runner
|
||||
git clone https://git.vfsh.dev/voidf1sh/nodbot
|
||||
cd nodbot
|
||||
git checkout tags/${{ gitea.ref_name }}
|
||||
- name: Build the Docker image
|
||||
run: |
|
||||
|
||||
Loading…
Reference in New Issue
Block a user