Add .drone.yml
This commit is contained in:
parent
100a29e530
commit
79b0350e27
2 changed files with 53 additions and 36 deletions
53
.drone.yml
Normal file
53
.drone.yml
Normal file
|
@ -0,0 +1,53 @@
|
||||||
|
---
|
||||||
|
kind: pipeline
|
||||||
|
type: docker
|
||||||
|
name: update-script
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Update flake
|
||||||
|
image: nixos/nix
|
||||||
|
commands:
|
||||||
|
- echo "substituters = https://cache.nixos.org/ https://f000.backblazeb2.com/file/cache-chir-rs/" >> /etc/nix/nix.conf
|
||||||
|
- echo "trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= nixcache:8KKuGz95Pk4UJ5W/Ni+pN+v+LDTkMMFV4yrGmAYgkDg= hydra.nixos.org-1:CNHJZBh9K4tP3EKF6FkkgeVYsS3ohTl+oS0Qa8bezVs=" >> /etc/nix/nix.conf
|
||||||
|
- nix flake update
|
||||||
|
- (cd minecraft && ./update.sh)
|
||||||
|
- (cd mastodon && ./update.sh)
|
||||||
|
- (cd matrix/matrix-media-repo && ./update.sh)
|
||||||
|
- (cd art && ./update.sh)
|
||||||
|
- nix fmt
|
||||||
|
- name: Push git
|
||||||
|
image: appleboy/drone-git-push
|
||||||
|
settings:
|
||||||
|
ssh_key:
|
||||||
|
from_secret: SSH_KEY
|
||||||
|
remote: gitea@git.chir.rs:darkkirb/nixos-config.git
|
||||||
|
branch: update-package
|
||||||
|
force: true
|
||||||
|
commit: true
|
||||||
|
commit_message: Update packages
|
||||||
|
author_name: Gitea Bot
|
||||||
|
author_email: gitea-bot@chir.rs
|
||||||
|
- name: Create pull request
|
||||||
|
image: alpine:latest
|
||||||
|
commands:
|
||||||
|
- apk add jq curl
|
||||||
|
- |
|
||||||
|
echo '{ "assignee": "DarkKirb", "base": "main", "head": "update-packages", "title": "Update packages" }' | jq '.body = $body' --arg body "$(cat ../pr-message.txt)" | curl -XPOST 'https://git.chir.rs/api/v1/repos/DarkKirb/nix-packages/pulls' -H "Accept: application/json" -H "Content-Type: application/json" -H "Authorization: Bearer $AUTHORISATION" -d-
|
||||||
|
environment:
|
||||||
|
AUTHORISATION:
|
||||||
|
from_secret: GITEA_KEY
|
||||||
|
trigger:
|
||||||
|
event:
|
||||||
|
- cron
|
||||||
|
cron:
|
||||||
|
- updater
|
||||||
|
---
|
||||||
|
kind: pipeline
|
||||||
|
type: docker
|
||||||
|
name: notify-hydra
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Notify hydra
|
||||||
|
image: curlimages/curl:latest
|
||||||
|
commands:
|
||||||
|
- curl --get --data-urlencode "jobsets=nixos-config:nixos-config" https://hydra.chir.rs/api/push
|
36
.github/workflows/update-flake.yaml
vendored
36
.github/workflows/update-flake.yaml
vendored
|
@ -1,36 +0,0 @@
|
||||||
name: update-flake-lock
|
|
||||||
on:
|
|
||||||
workflow_dispatch: # allows manual triggering
|
|
||||||
schedule:
|
|
||||||
- cron: "16 20 * * *"
|
|
||||||
jobs:
|
|
||||||
lockfile:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: Checkout repository
|
|
||||||
uses: actions/checkout@v3
|
|
||||||
- name: Install Nix
|
|
||||||
uses: cachix/install-nix-action@v17
|
|
||||||
with:
|
|
||||||
nix_path: nixpkgs=channel:nixos-unstable
|
|
||||||
extra_nix_config: |
|
|
||||||
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}
|
|
||||||
- name: Update flake.lockfile
|
|
||||||
run: nix flake update
|
|
||||||
- name: Run update script for minecraft
|
|
||||||
run: cd minecraft && ./update.sh
|
|
||||||
- name: Run update script for mastodon
|
|
||||||
run: cd mastodon && ./update.sh
|
|
||||||
- name: Run update script for matrix-media-repo
|
|
||||||
run: cd matrix/matrix-media-repo && ./update.sh
|
|
||||||
- name: Run update script for lotte-art
|
|
||||||
run: cd art && ./update.sh
|
|
||||||
- name: Run update script for drone-runner-docker
|
|
||||||
run: cd ci/drone-runner-docker && ./update.sh
|
|
||||||
- name: Run nix formatter
|
|
||||||
run: nix fmt
|
|
||||||
- name: Commit and push
|
|
||||||
uses: peter-evans/create-pull-request@v4
|
|
||||||
with:
|
|
||||||
commit-message: "Automatic Update"
|
|
||||||
title: Run automatic update
|
|
Reference in a new issue