Bump actions/cache from 3 to 4 (#178) #139
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: CI main | |
on: | |
push: | |
branches: | |
- main | |
concurrency: | |
group: main-${{ github.ref }} | |
cancel-in-progress: true | |
permissions: | |
contents: read # to fetch code (actions/checkout) | |
jobs: | |
cache: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write # to push to repo | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: cachix/install-nix-action@v25 | |
with: | |
nix_path: nixpkgs=channel:nixos-22.05 | |
- uses: cachix/cachix-action@v14 | |
with: | |
name: nix-community | |
authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}" | |
- name: Build derivations | |
run: | | |
nix build . | |
- name: Print store paths | |
run: | | |
cat result/buildInputs | |
- name: Get current short git commit | |
id: current_commit | |
run: | | |
echo "REV=$(git rev-parse --short HEAD)" >> $GITHUB_ENV | |
- name: Generate repo.json | |
run: | | |
nix-shell -p nodejs --run "cd .github/repo_pinner && npm install && node index.mjs ../../result/buildInputs" | |
mv .github/repo_pinner/repo.json repo-new.json | |
git fetch | |
git checkout origin/repo | |
git pull origin repo | |
rm repo.json | |
mv repo-new.json repo.json | |
env: | |
WEB3STORAGE_TOKEN: ${{ secrets.WEB3STORAGE_TOKEN }} | |
- name: Commit files | |
continue-on-error: true | |
run: | | |
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
git config --local user.name "github-actions[bot]" | |
git add repo.json | |
git commit -m "update: ${{ env.REV }}" | |
- name: Push changes | |
continue-on-error: true | |
uses: ad-m/github-push-action@master | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
branch: "refs/heads/repo" |