-
Notifications
You must be signed in to change notification settings - Fork 5.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #16 from mitchmindtree/refresh-manifests-ci
Add a workflow to automate the refreshing of manifests
- Loading branch information
Showing
1 changed file
with
52 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
name: "refresh-manifests" | ||
|
||
on: | ||
schedule: | ||
- cron: '0 0 * * *' # Midnight UTC | ||
workflow_dispatch: | ||
|
||
jobs: | ||
refresh-manifests: | ||
name: "Refresh manifests and sync channels" | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/[email protected] | ||
with: | ||
persist-credentials: false | ||
ref: main | ||
- uses: cachix/install-nix-action@v16 | ||
with: | ||
nix_path: nixpkgs=channel:nixos-unstable | ||
- uses: cachix/cachix-action@v10 | ||
with: | ||
name: mitchmindtree-fuellabs | ||
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}' | ||
- name: Refresh manifests | ||
timeout-minutes: 5 | ||
run: nix run .#refresh-manifests | ||
- name: Check and commit changes | ||
id: commit | ||
continue-on-error: true | ||
run: | | ||
git config --local user.email "[email protected]" | ||
git config --local user.name "GitHub Action" | ||
git add manifests | ||
git commit -m "manifest: update" | ||
- name: Validate nix files changed | ||
if: steps.commit.outcome == 'success' | ||
run: | | ||
files=( $(git diff --name-only HEAD HEAD^ '*.nix') ) | ||
echo "${#files[*]} nix files changed: ${files[*]}" | ||
if [[ "${#files[*]}" -ne 0 ]]; then | ||
nix-instantiate --parse "${files[@]}" >/dev/null | ||
fi | ||
- name: Build fuel for cache | ||
run: nix build --print-build-logs --no-update-lock-file .#fuel | ||
- name: Build fuel-nightly for cache | ||
run: nix build --print-build-logs --no-update-lock-file .#fuel-nightly | ||
- name: Push changes | ||
if: steps.commit.outcome == 'success' | ||
uses: ad-m/github-push-action@master | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
branch: main |