diff --git a/.github/workflows/cache.yaml b/.github/workflows/cache.yaml deleted file mode 100644 index 931ad252..00000000 --- a/.github/workflows/cache.yaml +++ /dev/null @@ -1,26 +0,0 @@ -name: build and push cache to attic - -on: - push: - workflow_dispatch: - -jobs: - cache: - runs-on: self-hosted - steps: - - uses: actions/checkout@v4 - - name: connect to attic - run: | - attic login --set-default atticd http://localhost:8080/ ${{ secrets.ATTIC_TOKEN }} - attic use local - - name: build - run: | - nix-fast-build \ - --flake .#build \ - --option access-tokens github.com=${{ secrets.PAT }} \ - --no-nom \ - --systems "x86_64-linux" \ - --skip-cached \ - --attic-cache local \ - --eval-max-memory-size 4096 \ - --eval-workers 3 diff --git a/.github/workflows/mirror.yaml b/.github/workflows/mirror.yaml new file mode 100644 index 00000000..b40dad7a --- /dev/null +++ b/.github/workflows/mirror.yaml @@ -0,0 +1,60 @@ +name: Mirror from declaratia + +permissions: write-all + +on: + schedule: + - cron: "0 0 * * *" + workflow_dispatch: + +jobs: + sync: + runs-on: ubuntu-latest + + steps: + - run: | + git config --global user.name "github-actions[bot]" + git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com" + + - uses: actions/setup-python@v5 + with: + python-version: "3.13" + + - uses: actions/checkout@v3 + with: + repository: newren/git-filter-repo + path: git-filter-repo + + - uses: actions/checkout@v3 + with: + repository: merrkry/declaratia + fetch-depth: 0 + path: declaratia + ref: master + token: ${{ secrets.PAT }} + + - uses: actions/checkout@v3 + with: + repository: merrkry/decalratia + path: decalratia + ref: master + + - run: | + cd declaratia + python ../git-filter-repo/git-filter-repo --path flake.lock --invert-paths --force + + - run: | + rm -rf declaratia/.github/workflows + mkdir -p declaratia/.github/workflows + cp -r decalratia/.github/workflows/* declaratia/.github/workflows/ + cd declaratia + git add .github/workflows + git commit -m "ci: override workflows" + + - uses: ad-m/github-push-action@master + with: + branch: master + force: true + directory: declaratia + repository: merrkry/decalratia + github_token: ${{ secrets.PAT }}