aboutsummaryrefslogtreecommitdiffstats
path: root/.gitea/workflows/git-sync.yaml
blob: 561f3b43cd0483c6d99b50be259df7bfbeb39fdd (plain)
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
name: git-sync-with-mirror

on:
  push:
    branches: [ master ]
  pull_request:
    branches: [ master ]
  workflow_dispatch:

jobs:
  test:
    runs-on: ubuntu-latest
    timeout-minutes: 10

    steps:
      - name: Checkout
        uses: actions/checkout@v4

      - name: Install Emacs
        run: |
          sudo apt-get update
          sudo apt-get install -y emacs-nox

      - name: Setup environment
        run: |
          cp .env.example .env

      - name: Load configuration
        run: |
          emacs --batch -l init.el

      - name: Byte compile configuration
        run: |
          emacs --batch -f batch-byte-compile init.el modules/*.el

  git-sync:
    runs-on: ubuntu-latest
    needs: test
    timeout-minutes: 15

    steps:
      - name: Checkout
        uses: actions/checkout@v4

      - name: git-sync
        env:
          git_sync_source_repo: git@git.fridu.us:heckyel/emacs-personal.git
          git_sync_destination_repo: ssh://git@c.fridu.us/software/emacs-personal.git
        if: env.git_sync_source_repo && env.git_sync_destination_repo
        uses: astounds/git-sync@v1
        with:
          source_repo: git@git.fridu.us:heckyel/emacs-personal.git
          source_branch: "master"
          destination_branch: "master"
          destination_repo: ssh://git@c.fridu.us/software/emacs-personal.git
          source_ssh_private_key: ${{ secrets.GIT_SYNC_SOURCE_SSH_PRIVATE_KEY }}
          destination_ssh_private_key:  ${{ secrets.GIT_SYNC_DESTINATION_SSH_PRIVATE_KEY }}

      - name: git-sync-sourcehut
        env:
          git_sync_source_repo: git@git.fridu.us:heckyel/emacs-personal.git
          git_sync_destination_repo: git@git.sr.ht:~heckyel/emacs-personal
        if: env.git_sync_source_repo && env.git_sync_destination_repo
        uses: astounds/git-sync@v1
        with:
          source_repo: git@git.fridu.us:heckyel/emacs-personal.git
          source_branch: "master"
          destination_branch: "master"
          destination_repo: git@git.sr.ht:~heckyel/emacs-personal
          source_ssh_private_key: ${{ secrets.GIT_SYNC_SOURCE_SSH_PRIVATE_KEY }}
          destination_ssh_private_key:  ${{ secrets.GIT_SYNC_DESTINATION_SSH_PRIVATE_KEY }}