-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from LegitCamper/overhaul
Overhaul
- Loading branch information
Showing
29 changed files
with
1,155 additions
and
680 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,62 +1,57 @@ | ||
name: Update Homelab Files | ||
name: Update Homelab Servers | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
- overhaul | ||
workflow_dispatch: | ||
|
||
env: | ||
DOCKER_FILES: -f ai.yml -f monitor.yml -f network.yml -f media.yml -f utilities.yml | ||
DOCKER_ENV: --env-file ./secrets/homelab.env | ||
DOCKER_FLAGS: -d --remove-orphans | ||
|
||
jobs: | ||
deploy: | ||
runs-on: "self-hosted" | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- uses: actions/checkout@v4 | ||
with: | ||
repository: LegitCamper/homelab-secrets | ||
path: "secrets" | ||
sparse-checkout: | | ||
homelab.env | ||
sparse-checkout-cone-mode: false | ||
token: ${{ secrets.ACCESS_TOKEN }} | ||
|
||
- name: replace domain in configs | ||
run: | | ||
# add any other files that need domain substituion here - for flexablity | ||
sed -i -e 's/$DOMAIN/${{ vars.DOMAIN }}/g' ./dashy/conf.yml | ||
- name: install ansible | ||
run: sudo apt-get install -y ansible | ||
|
||
- name: install docker compose for tests | ||
uses: KengoTODA/actions-setup-docker-compose@v1 | ||
- name: Run gateway playbook | ||
uses: dawidd6/action-ansible-playbook@v2 | ||
with: | ||
version: "2.14.2" | ||
|
||
- name: docker compose dry run | ||
run: | | ||
docker compose --dry-run ${{ env.DOCKER_ENV }} ${{ env.DOCKER_FILES }} up ${{ env.DOCKER_FLAGS }} | ||
exit $? | ||
- name: Copy folder content recursively to remote | ||
uses: garygrossgarten/[email protected] | ||
with: | ||
local: ${{ github.workspace }} | ||
remote: /home/${{ secrets.SSH_USER }}/stacks/homelab/ | ||
host: ${{ secrets.HOST }} | ||
username: ${{ secrets.SSH_USER }} | ||
password: ${{ secrets.PASSWORD }} | ||
|
||
- name: multiple command | ||
uses: appleboy/ssh-action@v1.0.3 | ||
playbook: gateway.yml | ||
directory: ./ | ||
vault_password: ${{secrets.VAULT_PASSWORD}} | ||
requirements: requirements.yml | ||
inventory: | | ||
[all] | ||
gateway | ||
configuration: | | ||
[defaults] | ||
host_key_checking = False | ||
[ssh_connections] | ||
pipelining = true | ||
options: | | ||
--inventory .hosts | ||
--verbose | ||
- name: Run homeserver playbook | ||
uses: dawidd6/action-ansible-playbook@v2 | ||
with: | ||
host: ${{ secrets.HOST }} | ||
username: ${{ secrets.SSH_USER }} | ||
password: ${{ secrets.PASSWORD }} | ||
script: | | ||
cd ~/stacks/homelab/ | ||
docker compose ${{ env.DOCKER_ENV }} ${{ env.DOCKER_FILES }} up ${{ env.DOCKER_FLAGS }} | ||
playbook: homeserver.yml | ||
directory: ./ | ||
vault_password: ${{secrets.VAULT_PASSWORD}} | ||
requirements: requirements.yml | ||
inventory: | | ||
[all] | ||
homeserver | ||
configuration: | | ||
[defaults] | ||
host_key_checking = False | ||
ask_sudo_pass = True | ||
[ssh_connections] | ||
pipelining = true | ||
options: | | ||
--inventory .hosts | ||
--verbose |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
secrets | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
[defaults] | ||
ask_vault_pass=True | ||
|
||
[ssh_connections] | ||
pipelining = true |
Oops, something went wrong.