Compare commits

...

10 Commits

Author SHA1 Message Date
Palash Tyagi
c0713c2b3a
Merge 0a9d9e38c35f4e68eeec41de44faf1dfb973c9e4 into 04fbf5ca50258299932c344b82a2e0b2049de142 2025-05-03 23:11:36 +01:00
04fbf5ca50
Merge pull request #36 from Magnus167/runner-upgrade
Update Docker setup for GitHub runner management
2025-05-03 22:58:19 +01:00
Palash Tyagi
49c9e7f66d Add start.sh script to manage Docker container startup 2025-05-03 22:40:08 +01:00
Palash Tyagi
08a4871907 Comment out container_name in docker-compose.yml to allow for multiple runners 2025-05-03 22:28:15 +01:00
Palash Tyagi
dbb95c9b1a renamed start to entrypoint 2025-05-03 22:25:31 +01:00
Palash Tyagi
8417b9e5d7 Update Dockerfile to use entrypoint.sh instead of start.sh 2025-05-03 22:25:17 +01:00
0a9d9e38c3
Merge branch 'main' into floatops 2025-05-03 01:32:25 +01:00
4d846287e8
Merge branch 'main' into floatops 2025-05-02 23:38:46 +01:00
bdd3293c65
Merge branch 'main' into floatops 2025-05-01 01:08:16 +01:00
Palash Tyagi
bda1298397 empty commit 2025-05-01 01:05:37 +01:00
4 changed files with 31 additions and 26 deletions

View File

@ -18,13 +18,13 @@ RUN cd /home/docker && mkdir actions-runner && cd actions-runner \
RUN chown -R docker ~docker && /home/docker/actions-runner/bin/installdependencies.sh
COPY start.sh start.sh
COPY entrypoint.sh entrypoint.sh
# make the script executable
RUN chmod +x start.sh
RUN chmod +x entrypoint.sh
# since the config and run script for actions are not allowed to be run by root,
# set the user to "docker" so all subsequent commands are run as the docker user
USER docker
ENTRYPOINT ["./start.sh"]
ENTRYPOINT ["./entrypoint.sh"]

View File

@ -6,7 +6,8 @@ services:
context: .
args:
RUNNER_VERSION: 2.323.0
container_name: github-runner
# container_name commented to allow for multiple runners
# container_name: github-runner
env_file:
- .env
volumes:

24
.github/runner/entrypoint.sh vendored Normal file
View File

@ -0,0 +1,24 @@
#!/bin/bash
REPOSITORY=$REPO
ACCESS_TOKEN=$GH_TOKEN
LABELS=$RUNNER_LABELS
# echo "REPO ${REPOSITORY}"
# echo "ACCESS_TOKEN ${ACCESS_TOKEN}"
REG_TOKEN=$(curl -X POST -H "Authorization: token ${ACCESS_TOKEN}" -H "Accept: application/vnd.github+json" https://api.github.com/repos/${REPOSITORY}/actions/runners/registration-token | jq .token --raw-output)
cd /home/docker/actions-runner
./config.sh --url https://github.com/${REPOSITORY} --token ${REG_TOKEN} --labels ${LABELS}
cleanup() {
echo "Removing runner..."
./config.sh remove --unattended --token ${REG_TOKEN}
}
trap 'cleanup; exit 130' INT
trap 'cleanup; exit 143' TERM
./run.sh & wait $!

View File

@ -1,24 +1,4 @@
#!/bin/bash
REPOSITORY=$REPO
ACCESS_TOKEN=$GH_TOKEN
LABELS=$RUNNER_LABELS
# echo "REPO ${REPOSITORY}"
# echo "ACCESS_TOKEN ${ACCESS_TOKEN}"
REG_TOKEN=$(curl -X POST -H "Authorization: token ${ACCESS_TOKEN}" -H "Accept: application/vnd.github+json" https://api.github.com/repos/${REPOSITORY}/actions/runners/registration-token | jq .token --raw-output)
cd /home/docker/actions-runner
./config.sh --url https://github.com/${REPOSITORY} --token ${REG_TOKEN} --labels ${LABELS}
cleanup() {
echo "Removing runner..."
./config.sh remove --unattended --token ${REG_TOKEN}
}
trap 'cleanup; exit 130' INT
trap 'cleanup; exit 143' TERM
./run.sh & wait $!
docker compose up -d --build
# docker compose up -d --build --scale github-runner=2