I want to create a github action that creates a new docker build and starts it up when something is pushed in the main branch. But the problem is that I set the working dir of the actions-runner to ~/action-runner/_work/. My Bot with the dockerfile and docker-compose.yml are located in ~/football-minigame/
How can I solve this problem so the runner puts the file in the ~/football-minigame/ directory so I can stop the bot and restart it with the new code?
Here is my action.yml
name: Deploy Bot
on:
push:
branches:
- main
jobs:
deploy:
runs-on: self-hosted
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Change dir
run: cd ~/football-minigame
- name: Stop Bot
run: |
docker-compose down
- name: Building and pushing image
run: |
docker-compose build
- name: Start the bot
run: |
docker-compose up -d
Is it a possible solution to put the dockerfile and the docker-compose.yml to github so the action runner pulls them with? Also what is with config files? can I let them in the main branch or does the runner doesn’t overwrite them?
I tried googling and fixing the problem with my known resources