Skip to content

Commit

Permalink
Merge pull request #16 from mitchmindtree/refresh-manifests-ci
Browse files Browse the repository at this point in the history
Add a workflow to automate the refreshing of manifests
  • Loading branch information
mitchmindtree authored Sep 20, 2022
2 parents 46a30cc + abbcf80 commit 702822d
Showing 1 changed file with 52 additions and 0 deletions.
52 changes: 52 additions & 0 deletions .github/workflows/refresh-manifests.yml
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

0 comments on commit 702822d

Please sign in to comment.