diff --git a/.forgejo/workflows/botserver.yaml b/.forgejo/workflows/botserver.yaml index 60336fcb..db5c6c8a 100644 --- a/.forgejo/workflows/botserver.yaml +++ b/.forgejo/workflows/botserver.yaml @@ -16,17 +16,29 @@ jobs: run: | set -e - # Clean and setup - rm -rf ~/workspace ~/gb-ws - mkdir -p ~/workspace/target - mkdir -p ~/cache + # Setup directories + mkdir -p ~/workspace ~/cache cd ~/workspace - # Clone fresh - git clone --depth 1 --branch main https://alm.pragmatismo.com.br/GeneralBots/botlib.git - git clone --depth 1 --branch main https://alm.pragmatismo.com.br/GeneralBots/BotServer.git botserver - git clone --depth 1 --branch main https://alm.pragmatismo.com.br/GeneralBots/gb.git ~/gb-ws + # Clone or update repos + if [ ! -d botlib ]; then + git clone --depth 1 --branch main https://alm.pragmatismo.com.br/GeneralBots/botlib.git + else + cd botlib && git pull && cd .. + fi + + if [ ! -d botserver ]; then + git clone --depth 1 --branch main https://alm.pragmatismo.com.br/GeneralBots/BotServer.git botserver + else + cd botserver && git pull && cd .. + fi + + if [ ! -d ~/gb-ws ]; then + git clone --depth 1 --branch main https://alm.pragmatismo.com.br/GeneralBots/gb.git ~/gb-ws + else + cd ~/gb-ws && git pull && cd ~/workspace + fi # Setup Cargo.toml cp ~/gb-ws/Cargo.toml ~/workspace/Cargo.toml