From b7846862cf7371560f7d19c3a615911c95a43af6 Mon Sep 17 00:00:00 2001 From: db0 Date: Fri, 29 Dec 2023 17:46:51 +0100 Subject: [PATCH] feat: allow to update gui with github actions --- .../{deploy.yml => fediseer_api.yml} | 6 +-- .github/workflows/fediseer_gui.yml | 38 +++++++++++++++++++ .../{deploy.yml => fediseer_api_deploy.yml} | 0 ansible/fediseer_gui_deploy.yml | 16 ++++++++ 4 files changed, 57 insertions(+), 3 deletions(-) rename .github/workflows/{deploy.yml => fediseer_api.yml} (89%) create mode 100644 .github/workflows/fediseer_gui.yml rename ansible/{deploy.yml => fediseer_api_deploy.yml} (100%) create mode 100644 ansible/fediseer_gui_deploy.yml diff --git a/.github/workflows/deploy.yml b/.github/workflows/fediseer_api.yml similarity index 89% rename from .github/workflows/deploy.yml rename to .github/workflows/fediseer_api.yml index 848a85d..6f5d2d9 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/fediseer_api.yml @@ -1,4 +1,4 @@ -name: Deploy new version +name: Deploy new fediseer API version on: workflow_dispatch: @@ -9,7 +9,7 @@ permissions: jobs: build-n-deploy: - name: Fediseer new release + name: Fediseer new API release runs-on: ubuntu-latest steps: - name: "✔️ Checkout" @@ -20,7 +20,7 @@ jobs: uses: dawidd6/action-ansible-playbook@v2 with: # Required, playbook filepath - playbook: ansible/deploy.yml + playbook: ansible/fediseer_api_deploy.yml # Optional, directory where playbooks live directory: ./ # Optional, SSH private key diff --git a/.github/workflows/fediseer_gui.yml b/.github/workflows/fediseer_gui.yml new file mode 100644 index 0000000..14ac14a --- /dev/null +++ b/.github/workflows/fediseer_gui.yml @@ -0,0 +1,38 @@ +name: Deploy new fediseer GUI version + +on: + workflow_dispatch: + +permissions: + contents: write + pull-requests: read + +jobs: + build-n-deploy: + name: Fediseer new GUI release + runs-on: ubuntu-latest + steps: + - name: "✔️ Checkout" + uses: actions/checkout@v3 + with: + fetch-depth: 0 + - name: Run playbook + uses: dawidd6/action-ansible-playbook@v2 + with: + # Required, playbook filepath + playbook: ansible/fediseer_gui_deploy.yml + # Optional, directory where playbooks live + directory: ./ + # Optional, SSH private key + key: ${{secrets.SSH_PRIVATE_KEY}} + # Optional, SSH known hosts file content + known_hosts: | + ${{secrets.SSH_FEDISEER_IP}} ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDuk6apo8+3YzU6WQ7WYu4F/9Pf1Nc1w4QXTqLsIlTmd + # # Optional, encrypted vault password + # vault_password: ${{secrets.VAULT_PASSWORD}} + # Optional, galaxy requirements filepath + # requirements: galaxy-requirements.yml + # Optional, additional flags to pass to ansible-playbook + options: | + --inventory ansible/inventory.yml + -e docker_compose_dir=${{secrets.DOCKER_COMPOSE_DIR}} diff --git a/ansible/deploy.yml b/ansible/fediseer_api_deploy.yml similarity index 100% rename from ansible/deploy.yml rename to ansible/fediseer_api_deploy.yml diff --git a/ansible/fediseer_gui_deploy.yml b/ansible/fediseer_gui_deploy.yml new file mode 100644 index 0000000..820ecc7 --- /dev/null +++ b/ansible/fediseer_gui_deploy.yml @@ -0,0 +1,16 @@ +--- + +- hosts: fediseer + gather_facts: false + + tasks: + - name: start docker-compose + docker_compose: + project_src: "{{docker_compose_dir}}" + state: present + pull: yes + remove_orphans: yes + become: true + tags: + - docker + - compose