-
Notifications
You must be signed in to change notification settings - Fork 1
57 lines (48 loc) · 1.51 KB
/
auto-push.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
name: auto-push
on:
workflow_dispatch:
push:
branches:
- main
- master
schedule:
- cron: '55 5 * * *'
jobs:
auto-push:
name: Auto push to private repo
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up QEMU
id: qemu
uses: docker/setup-qemu-action@v3
with:
image: tonistiigi/binfmt:latest
platforms: all
- name: Install nix
uses: cachix/install-nix-action@v26
with:
github_access_token: ${{ secrets.AUTOMERGE_TOKEN }}
extra_nix_config: |
extra-platforms = i686-linux aarch64-linux arm-linux
- name: Build nix packages
run: |
cat > secrets.toml <<EOF
[keys]
github = "${{ secrets.AUTOMERGE_TOKEN }}"
EOF
nix run .#update
rm -f secrets.toml
- env:
API_TOKEN_GITHUB: ${{ secrets.AUTOMERGE_TOKEN }}
run: |
# https://github.com/cpina/github-action-push-to-another-repository/issues/75
git config --unset-all http.https://github.com/.extraheader
git config --global user.email "xddxdd@users.noreply.github.com"
git config --global user.name "github-actions[bot]"
git add .
git commit -m "auto: update packages"
git remote add private https://xddxdd-bot:$API_TOKEN_GITHUB@github.com/xddxdd/nixos-config-private-copy.git
git push -u private master --force