This commit is contained in:
davegallant
2024-01-07 22:31:44 +00:00
parent 63a4af7dc2
commit bb43b68166
74 changed files with 76 additions and 75 deletions

View File

@@ -21,7 +21,7 @@ After registering this runner and starting the daemon, the runner appeared in /a
Running a workflow# Now it’s time start running some automation. I used the demo workflow as a starting point to verify that the runner is executing workflows.
After this, I wanted to make sure that some of my existing workflows could be migrated over.
The following workflow uses a matrix to run a job for several of my hosts using ansible playbooks that will do various tasks such as patching os updates and updating container images.
name: Run ansible on: push: schedule: - cron: "0 */12 * * *" jobs: run-ansible-playbook: runs-on: ubuntu-latest strategy: matrix: host: - changedetection - homer - invidious - jackett - ladder - miniflux - plex - qbittorrent - tailscale-exit-node - tailscale-subnet-router - uptime-kuma steps: - name: Check out repository code uses: actions/checkout@v4 - name: Install ansible run: | apt update && apt install ansible -y - name: Run playbook uses: dawidd6/action-ansible-playbook@v2 with: playbook: playbooks/main.yml requirements: requirements.yml options: | --inventory inventory --limit \${{ matrix.host }} - name: Send failure notification uses: dawidd6/action-send-mail@v3 if: always() && failure() with: server_address: smtp.gmail.com server_port: 465 secure: true username: myuser password: \${{ secrets.MAIL_PASSWORD }} subject: ansible runbook '\${{ matrix.host }}' failed to: me@davegallant.ca from: RFD Notify body: | \${{ github.server_url }}/\${{ github.repository }}/actions/runs/\${{ github.run_number }} And voil\xE0:
name: Run ansible on: push: schedule: - cron: "0 */12 * * *" jobs: run-ansible-playbook: runs-on: ubuntu-latest strategy: matrix: host: - changedetection - homer - invidious - jackett - jellyfin - ladder - miniflux - plex - qbittorrent - tailscale-exit-node - tailscale-subnet-router - uptime-kuma steps: - name: Check out repository code uses: actions/checkout@v4 - name: Install ansible run: | apt update && apt install ansible -y - name: Run playbook uses: dawidd6/action-ansible-playbook@v2 with: playbook: playbooks/main.yml requirements: requirements.yml options: | --inventory inventory --limit \${{ matrix.host }} - name: Send failure notification uses: dawidd6/action-send-mail@v3 if: always() && failure() with: server_address: smtp.gmail.com server_port: 465 secure: true username: myuser password: \${{ secrets.MAIL_PASSWORD }} subject: ansible runbook '\${{ matrix.host }}' failed to: me@davegallant.ca from: RFD Notify body: | \${{ github.server_url }}/\${{ github.repository }}/actions/runs/\${{ github.run_number }} And voil\xE0:
You may be wondering how the gitea runner is allowed to connect to the other hosts using ansible? Well, the nodes are in the same tailnet and have tailscale ssh enabled.
Areas for improvement# One enhancement that I would like to see is the ability to send notifications on workflow failures. Currently, this doesn’t seem possible without adding logic to each workflow.
Conclusion# Gitea Actions are fast and the resource footprint is minimal. My gitea instance is currently using around 250mb of memory and a small fraction of a single cpu core (and the runner is using a similar amount of resources). This is impressive since many alternatives tend to require substantially more resources. It likely helps that the codebase is largely written in go.