fix: readme following migration #42
This file contains hidden or 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: Update CI | |
| on: | |
| push: | |
| branches: | |
| - main | |
| workflow_dispatch: | |
| permissions: | |
| contents: write | |
| id-token: write | |
| jobs: | |
| update: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| repo: | |
| - link: demo-bot | |
| template: rust-telegram | |
| - link: demo-server | |
| template: rust-actix | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Clone repository | |
| uses: actions/checkout@v4 | |
| with: | |
| repository: xinux-org/${{ matrix.repo.link }} | |
| - name: Install Nix | |
| uses: DeterminateSystems/nix-installer-action@main | |
| - name: Cache Nix store | |
| uses: DeterminateSystems/magic-nix-cache-action@main | |
| - name: Cleanup everything | |
| run: | | |
| shopt -s extglob dotglob | |
| rm -rf !(.git) | |
| - name: New template | |
| run: nix flake init --template github:xinux-org/templates#${{ matrix.repo.template }} --tarball-ttl 0 | |
| - name: Push changes | |
| run: | | |
| git config --global user.name 'github-actions[bot]' | |
| git config --global user.email '41898282+github-actions[bot]@users.noreply.github.com' | |
| git config --unset-all http.https://github.com/.extraheader | |
| if [[ -n $(git status --porcelain) ]]; then | |
| git add . | |
| git commit -m "Updated repo with latest template" | |
| git remote set-url origin "https://x-access-token:${GITHUB_TOKEN}@github.com/xinux-org/${{ matrix.repo.link }}.git" | |
| git push origin HEAD | |
| else | |
| echo "No changes detected. Skipping push." | |
| fi | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.PAT }} |