dotfiles

My PC Dotfiles & Website
commit 3827cf06e24c6cc6e5dbfab9c43a826d8ade9846
parent bf3a16b600715f937de453b69cbf6114b45008fb
Author: maydayv7 <maydayv7@gmail.com>
Date:   Fri, 25 Mar 2022 19:32:08 +0530

feat(ci): Add GitHub Actions

Diffstat:

A.github/ISSUE_TEMPLATE/bug-report.md | 40++++++++++++++++++++++++++++++++++++++++
A.github/ISSUE_TEMPLATE/feature-request.md | 19+++++++++++++++++++
A.github/ISSUE_TEMPLATE/help-request.md | 32++++++++++++++++++++++++++++++++
A.github/dependabot.yml | 10++++++++++
A.github/workflows/build.yml | 43+++++++++++++++++++++++++++++++++++++++++++
A.github/workflows/check.yml | 25+++++++++++++++++++++++++
A.github/workflows/release.yml | 30++++++++++++++++++++++++++++++
A.github/workflows/shell.yml | 28++++++++++++++++++++++++++++
A.github/workflows/update.yml | 59+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
A.github/workflows/website.yml | 33+++++++++++++++++++++++++++++++++
10 files changed, 319 insertions(+), 0 deletions(-)

diff --git a/.github/ISSUE_TEMPLATE/bug-report.md b/.github/ISSUE_TEMPLATE/bug-report.md @@ -0,0 +1,40 @@ +--- +name: Bug Report +about: Create a report to help improve the configuration +title: "" +labels: bug +assignees: maydayv7 +--- + +### Describe the bug + +A clear and concise description of what the bug is + +### Steps To Reproduce + +Steps to reproduce the behavior: + +1. ... +2. ... +3. ... + +### Expected behavior + +A clear and concise description of what you expected to happen + +### Screenshots + +If applicable, add screenshots to help explain your problem + +### Additional context + +Add any other context about the problem + +### Metadata + +Please run `nix-shell -p nix-info --run "nix-info -m"` and paste the result + +```console +[user@system:~]$ nix-shell -p nix-info --run "nix-info -m" +output here +``` diff --git a/.github/ISSUE_TEMPLATE/feature-request.md b/.github/ISSUE_TEMPLATE/feature-request.md @@ -0,0 +1,19 @@ +--- +name: Feature request +about: Suggest an idea for this project +title: "" +labels: enhancement +assignees: maydayv7 +--- + +**Is your feature request related to a problem? Please describe.** +A clear and concise description of what the problem is + +**Describe the solution you'd like** +A clear and concise description of what you want to happen + +**Describe alternatives you've considered** +A clear and concise description of any alternative solutions or features you've considered, if applicable + +**Additional context** +Add any other context or screenshots diff --git a/.github/ISSUE_TEMPLATE/help-request.md b/.github/ISSUE_TEMPLATE/help-request.md @@ -0,0 +1,32 @@ +--- +name: Help Request +about: Request for help or clarification on anything related to this project +title: "" +labels: help wanted, question +assignees: maydayv7 +--- + +### Description + +A clear and concise description of what problem you're facing or any area where clarification is required + +### Expected behavior + +A clear and concise description of what you expect to happen + +### Screenshots + +If applicable, add screenshots to help explain your problem + +### Additional context + +Add any other context about the problem + +### Metadata + +Please run `nix-shell -p nix-info --run "nix-info -m"` and paste the result. + +```console +[user@system:~]$ nix-shell -p nix-info --run "nix-info -m" +output here +``` diff --git a/.github/dependabot.yml b/.github/dependabot.yml @@ -0,0 +1,10 @@ +version: 2 +updates: + - package-ecosystem: github-actions + directory: "/" + schedule: + interval: daily + open-pull-requests-limit: 5 + commit-message: + prefix: "ci" + include: "scope" diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml @@ -0,0 +1,43 @@ +name: "ci: Build `nixosConfigurations`" +on: + workflow_dispatch: + workflow_call: + push: + tags: + - "*" + paths: + - "**.lock" + pull_request: + types: [opened, synchronize, reopened, ready_for_review] + paths-ignore: + - "**.md" + - "**.yml" + - "docs/**" + - "files/**" + - "shells/**" +env: + NIX_SHOW_STATS: 1 +jobs: + build: + if: github.event.pull_request.draft == false + runs-on: ubuntu-latest + strategy: + max-parallel: 1 + fail-fast: false + matrix: + device: [Vortex, Futura] + steps: + - name: Install Nix + uses: cachix/install-nix-action@v16 + with: + extra_nix_config: | + experimental-features = nix-command flakes + accept-flake-config = true + access-tokens = github.com=${{ secrets.GITHUB_TOKEN }} + - name: Setup Cachix + uses: cachix/cachix-action@v10 + with: + name: maydayv7-dotfiles + authToken: "${{ secrets.CACHIX_TOKEN }}" + - name: Build Configuration + run: nix build github:maydayv7/dotfiles#nixosConfigurations.${{ matrix.device }}.config.system.build.toplevel -L --show-trace diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml @@ -0,0 +1,25 @@ +name: "ci: Check Syntax" +on: + workflow_dispatch: + push: + paths-ignore: + - "**.md" + - "**.yml" + - "docs/**" + - "files/**" + - "shells/**" +env: + NIX_SHOW_STATS: 1 +jobs: + check: + runs-on: ubuntu-latest + steps: + - name: Install Nix + uses: cachix/install-nix-action@v16 + with: + extra_nix_config: | + experimental-features = nix-command flakes + accept-flake-config = true + access-tokens = github.com=${{ secrets.GITHUB_TOKEN }} + - name: Check Syntax + run: nix flake check github:maydayv7/dotfiles --keep-going diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml @@ -0,0 +1,30 @@ +name: "ci: Create Release" +on: + push: + tags: + - "*" +env: + NIX_SHOW_STATS: 1 +jobs: + release: + runs-on: ubuntu-latest + steps: + - name: Install Nix + uses: cachix/install-nix-action@v16 + with: + extra_nix_config: | + experimental-features = nix-command flakes + accept-flake-config = true + access-tokens = github.com=${{ secrets.GITHUB_TOKEN }} + - name: Build Default Install Media + run: nix build github:maydayv7/dotfiles#installMedia.xfce.config.system.build.isoImage -L --show-trace + - name: Draft Release + uses: ncipollo/release-action@v1.9.0 + with: + allowUpdates: true + artifactErrorsFailBuild: true + artifacts: "result/iso/nixos.iso" + draft: true + omitBodyDuringUpdate: true + omitNameDuringUpdate: true + token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/shell.yml b/.github/workflows/shell.yml @@ -0,0 +1,28 @@ +name: "ci: Check `devShells`" +on: + push: + paths: + - "shells/**" +env: + NIX_SHOW_STATS: 1 +jobs: + shell: + runs-on: ubuntu-latest + strategy: + matrix: + shell: [cc, format, go, java, lisp, lua, python, rust, video, website] + steps: + - name: Install Nix + uses: cachix/install-nix-action@v16 + with: + extra_nix_config: | + experimental-features = nix-command flakes + accept-flake-config = true + access-tokens = github.com=${{ secrets.GITHUB_TOKEN }} + - name: Setup Cachix + uses: cachix/cachix-action@v10 + with: + name: maydayv7-dotfiles + authToken: "${{ secrets.CACHIX_TOKEN }}" + - name: Check Shells + run: nix develop github:maydayv7/dotfiles#${{ matrix.shell }} diff --git a/.github/workflows/update.yml b/.github/workflows/update.yml @@ -0,0 +1,59 @@ +name: "chore: Automatic Scheduled Updates" +on: + workflow_dispatch: + schedule: + - cron: "0 0 * * 0" +env: + NIX_SHOW_STATS: 1 +jobs: + update: + runs-on: ubuntu-latest + steps: + - name: Clone Repo + uses: actions/checkout@v3 + with: + token: ${{ secrets.GITHUB_TOKEN }} + fetch-depth: 0 + - name: Install Nix + uses: cachix/install-nix-action@v16 + with: + nix_path: nixpkgs=channel:nixos-unstable + extra_nix_config: | + experimental-features = nix-command flakes + accept-flake-config = true + access-tokens = github.com=${{ secrets.GITHUB_TOKEN }} + - name: Update Flake Lock File + uses: DeterminateSystems/update-flake-lock@v8 + with: + pr-labels: dependencies + pr-title: > + chore(flake.lock): Update `inputs` + - name: Update Packages + env: + GIT_AUTHOR_NAME: github-actions[bot] + GIT_AUTHOR_EMAIL: <github-actions[bot]@users.noreply.github.com> + GIT_COMMITTER_NAME: github-actions[bot] + GIT_COMMITTER_EMAIL: <github-actions[bot]@users.noreply.github.com> + run: | + git checkout stable + cd packages && ./update.sh + - name: Create PR + uses: peter-evans/create-pull-request@v4 + with: + branch: update_packages + delete-branch: true + title: > + chore(packages): Automatic Updates + labels: dependencies + body: | + Automated package updates using `packages/update.sh`. + ### Running GitHub Actions on this PR + GitHub Actions will not run workflows on pull requests which are opened by a GitHub Action. + To run GitHub Actions workflows on this PR, run: + ```sh + git branch -D update_packages + git fetch origin + git checkout update_packages + git commit --amend --no-edit + git push origin update_packages --force + ``` diff --git a/.github/workflows/website.yml b/.github/workflows/website.yml @@ -0,0 +1,33 @@ +name: "ci: Build and Deploy Site" +on: + workflow_dispatch: + push: + branches: [stable] + push: + paths: + - "site/**" +jobs: + deploy: + runs-on: ubuntu-latest + steps: + - name: Clone Repo + uses: actions/checkout@v3 + with: + token: ${{ secrets.GITHUB_TOKEN }} + fetch-depth: 0 + - name: Install Nix + uses: cachix/install-nix-action@v16 + with: + extra_nix_config: | + experimental-features = nix-command flakes + accept-flake-config = true + access-tokens = github.com=${{ secrets.GITHUB_TOKEN }} + - name: Build Zola Site + run: nix build .#website + - name: Deploy to GitHub Pages + uses: peaceiris/actions-gh-pages@v3.8.0 + with: + github_token: ${{ secrets.ACCESS_TOKEN }} + publish_dir: ./result + publish_branch: deploy + cname: maydayv7.tk