From 5b0d0aa13e3c6214255ff4cbf13f908b1463577c Mon Sep 17 00:00:00 2001 From: Benjamin Hays Date: Sat, 12 Oct 2024 21:29:49 -0400 Subject: [PATCH] revert to pip version and try new caching method --- .gitea/workflows/ansible-deploy.yml | 24 +++-------------- .gitea/workflows/ansible-install.yml | 39 ++++++++++++++++++++++++++++ 2 files changed, 43 insertions(+), 20 deletions(-) create mode 100644 .gitea/workflows/ansible-install.yml diff --git a/.gitea/workflows/ansible-deploy.yml b/.gitea/workflows/ansible-deploy.yml index f7f2038..2368e0b 100644 --- a/.gitea/workflows/ansible-deploy.yml +++ b/.gitea/workflows/ansible-deploy.yml @@ -1,7 +1,11 @@ name: Ansible Deploy on: [push] jobs: + build: + uses: ./.gitea/workflows/ansible-install.yml + deploy: + needs: [ 'build' ] runs-on: ubuntu-latest env: RUNNER_TOOL_CACHE: /toolcache @@ -22,26 +26,6 @@ jobs: echo '${{secrets.SSH_PRIVATE_KEY}}' > ~/.ssh/id_rsa chmod 600 ~/.ssh/id_rsa - - uses: actions/checkout@v3 - with: - submodules: recursive - - - name: "Cache python packages" - uses: actions/cache@v3 - with: - path: ~/.cache/pip - key: ${{ runner.os }}-${{ env.ANSIBLE_VERSION }} - - - name: Install Ansible - run: | - apt update -y - apt install python3-pip -y - python3 -m pip install ansible==${{ env.ANSIBLE_VERSION }} - - #- name: Install Ansible Galaxy requirements - # run: | - # ansible-galaxy install -r requirements.yaml - - name: Run playbook uses: dawidd6/action-ansible-playbook@v2 with: diff --git a/.gitea/workflows/ansible-install.yml b/.gitea/workflows/ansible-install.yml new file mode 100644 index 0000000..1f78e34 --- /dev/null +++ b/.gitea/workflows/ansible-install.yml @@ -0,0 +1,39 @@ +name: Install Ansible using Pip + +on: + workflow_call: + +jobs: + build: + runs-on: ubuntu-latest + env: + RUNNER_TOOL_CACHE: /toolcache + ANSIBLE_VERSION: "8.7.0" + steps: + - name: Copy SSH Key + run: | + mkdir ~/.ssh/ + echo "Host *" > ~/.ssh/config + echo " StrictHostKeyChecking no" >> ~/.ssh/config + echo '${{secrets.SSH_PRIVATE_KEY}}' > ~/.ssh/id_rsa + chmod 600 ~/.ssh/id_rsa + + - uses: actions/checkout@v3 + with: + submodules: recursive + + - name: "Cache python packages" + uses: actions/cache@v3 + with: + path: ~/.cache/pip + key: ${{ runner.os }}-${{ env.ANSIBLE_VERSION }} + + - name: Install Ansible + run: | + apt update -y + apt install python3-pip -y + python3 -m pip install ansible==${{ env.ANSIBLE_VERSION }} + + #- name: Install Ansible Galaxy requirements + # run: | + # ansible-galaxy install -r requirements.yaml \ No newline at end of file