2023-05-26 22:19:20 +02:00
|
|
|
name: Plex Update
|
2023-05-26 22:35:14 +02:00
|
|
|
|
|
|
|
on:
|
2023-05-27 13:50:41 +02:00
|
|
|
push:
|
2023-05-28 10:33:52 +02:00
|
|
|
branches:
|
|
|
|
- main
|
|
|
|
- ci
|
2023-05-26 22:35:14 +02:00
|
|
|
schedule:
|
|
|
|
- cron: '0 0 * * *'
|
|
|
|
|
2023-05-26 22:19:20 +02:00
|
|
|
jobs:
|
2023-05-26 22:35:14 +02:00
|
|
|
update:
|
2023-09-09 10:35:36 +02:00
|
|
|
runs-on: docker
|
2023-05-26 22:19:20 +02:00
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v3
|
|
|
|
- env:
|
|
|
|
VAULT_ADDR: ${{ secrets.VAULT_ADDR }}
|
|
|
|
VAULT_TOKEN: ${{ secrets.VAULT_TOKEN }}
|
|
|
|
run: |
|
2023-09-09 10:38:35 +02:00
|
|
|
wget -O- https://apt.releases.hashicorp.com/gpg | sudo gpg --dearmor -o /usr/share/keyrings/hashicorp-archive-keyring.gpg
|
|
|
|
echo "deb [signed-by=/usr/share/keyrings/hashicorp-archive-keyring.gpg] https://apt.releases.hashicorp.com $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/hashicorp.list
|
|
|
|
sudo apt-get update && sudo apt-get install vault -y
|
|
|
|
|
|
|
|
|
2023-09-09 10:36:38 +02:00
|
|
|
|
2023-05-26 22:19:20 +02:00
|
|
|
git config user.name "Forgejo Actions Bot"
|
|
|
|
git config user.email "<>"
|
2023-05-26 22:26:33 +02:00
|
|
|
|
|
|
|
# Run Update script
|
2023-05-26 22:19:20 +02:00
|
|
|
./nixos/pkgs/plex-pass/update.sh
|
2023-05-26 22:26:33 +02:00
|
|
|
|
2023-05-26 22:19:20 +02:00
|
|
|
git add ./nixos/pkgs/plex-pass/
|
|
|
|
|
2023-05-26 22:30:44 +02:00
|
|
|
# Push if changed
|
2023-05-26 22:32:12 +02:00
|
|
|
if git status ./nixos/pkgs/plex-pass/ | grep -q "to be committed"; then
|
2023-05-26 22:26:33 +02:00
|
|
|
git commit -m "Update Plex"
|
|
|
|
git push origin main
|
|
|
|
fi
|