From cc2283fc6d9452c6be6be7d1255bef7e771b24e4 Mon Sep 17 00:00:00 2001 From: Sigmanificient Date: Mon, 6 May 2024 01:53:34 +0200 Subject: [PATCH] Add github action to update the screenshot --- .github/workflows/update-screenshot.yml | 35 +++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 .github/workflows/update-screenshot.yml diff --git a/.github/workflows/update-screenshot.yml b/.github/workflows/update-screenshot.yml new file mode 100644 index 0000000..18b65e5 --- /dev/null +++ b/.github/workflows/update-screenshot.yml @@ -0,0 +1,35 @@ +on: + workflow_dispatch: + push: + +jobs: + update_screeshot: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: cachix/install-nix-action@v26 + with: + nix_path: nixpkgs=channel:nixos-unstable + - uses: DeterminateSystems/magic-nix-cache-action@main + + - name: Install SSH key + uses: shimataro/ssh-key-action@v2 + with: + key: ${{ secrets.GH_SSH_PRIVATE_KEY }} + known_hosts: $GH_PUB_KEY + + - name: Get screenshot + run: | + nix build .\#screenshot-system.passthru.tests.qtile \ + --print-build-logs -v \ + --extra-experimental-features 'nix-command flakes' + + - name: Push in gist + run: | + git clone git@gist.github.com:9e1a986f1da9a1452e94103979c79aa4.git gist + + cp result/terminal.png gist/screenshot.png + cd gist + + git add -m "Update screenshot" + git push origin main