Automated update #2808
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: "Automated update" | |
on: | |
schedule: | |
- cron: '0 16 * * *' | |
workflow_dispatch: | |
push: | |
branches: | |
- main | |
jobs: | |
update: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
packages: write | |
services: | |
oranc: | |
image: ghcr.io/linyinfeng/oranc | |
steps: | |
- name: Checkout | |
uses: actions/checkout@main | |
with: | |
ref: main | |
token: '${{ secrets.PAT_FOR_AUTOMATED_UPDATE }}' | |
- name: Install nix | |
uses: cachix/install-nix-action@master | |
with: | |
github_access_token: '${{ secrets.GITHUB_TOKEN }}' | |
- name: Setup cachix | |
uses: cachix/cachix-action@master | |
with: | |
name: linyinfeng | |
signingKey: '${{ secrets.CACHIX_SIGNING_KEY }}' | |
- name: Git config | |
run: | | |
git config --global user.email "nano@linyinfeng.com" | |
git config --global user.name "Nano" | |
- name: Nix flake update | |
run: | | |
nix flake update --commit-lock-file | |
- name: Cargo update | |
run: | | |
nix develop --command cargo update | |
if [ -z $(git status --porcelain) ]; then | |
echo "clean, skip..." | |
else | |
git add --all | |
git commit --message "Cargo update" | |
fi | |
- name: Nix flake check | |
run: | | |
nix flake check | |
- name: Git push | |
run: | | |
git push |