[create-pull-request] automated change #932
Workflow file for this run
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: "nix build deployment test" | |
on: | |
workflow_run: | |
workflows: ["Automated-Update"] | |
push: | |
branches: [ "master", "update_flake_lock_action" ] | |
jobs: | |
cachix: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: cachix/install-nix-action@v20 | |
with: | |
nix_path: nixpkgs=channel:nixos-unstable | |
github_access_token: ${{ secrets.GITHUB_TOKEN }} | |
- uses: cachix/cachix-action@v12 | |
with: | |
name: coggiebot | |
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}' | |
- run: nix build .#coggiebot-stable | |
- run: cachix push coggiebot result | |
- run: nix build .#cache-target | |
- run: cachix push coggiebot result | |
# update-self: | |
# runs-on: ubuntu-latest | |
# steps: | |
# - uses: actions/checkout@v3 | |
# - uses: cachix/install-nix-action@v20 | |
# with: | |
# nix_path: nixpkgs=channel:nixos-unstable | |
# github_access_token: ${{ secrets.GITHUB_TOKEN }} | |
# - uses: cachix/cachix-action@v12 | |
# with: | |
# name: coggiebot | |
# authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}' | |
# - name: "setup box" | |
# run: | | |
# sudo -E bash <<EOF | |
# useradd coggiebot | |
# groupadd coggiebot | |
# usermod -a -G coggiebot coggiebot | |
# mkdir -p /var/coggiebot | |
# touch /var/coggiebot/.env | |
# EOF | |
# - name: "run update" | |
# run: | | |
# nix build .#deploy-workflow-ci | |
# sudo -E bash <<EOF | |
# export AUTHOR=$(echo $GITHUB_ACTION_REPOSITORY | cut -d '/' -f 1) | |
# export REPO=$(echo $GITHUB_ACTION_REPOSITORY | cut -d '/' -f 2) | |
# export BRANCH=$GITHUB_HEAD_REF | |
# ./result/update | |
# EOF | |
# - name: "deployment hooks exist" | |
# uses: andstor/file-existence-action@v2 | |
# with: | |
# files: "/var/coggiebot/result/enable, /var/coggiebot/result/disable, /var/coggiebot/result/start, /var/coggiebot/result/stop, /var/coggiebot/result/update" | |
# - name: "get version info" | |
# id: version_info | |
# run: | | |
# echo "COG_REV=$(/var/coggiebot/result/coggiebot --built-from --token '')" >> $GITHUB_OUTPUT | |
# echo "GIT_REV=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT | |
# # - name: "verify version is correct" | |
# # if: ${{ steps.version_info.outputs.COG_REV != steps.version_info.outputs.GIT_REV }} | |
# # run: exit 1 | |
# - run: echo "COG ${{ steps.version_info.outputs.COG_REV }}" | |
# - run: echo "GIT ${{ steps.version_info.outputs.GIT_REV }}" | |
# - run: systemctl status coggiebotd.service | |
# - run: systemctl status coggiebotd-update.timer | |
# - run: | | |
# nix build .#deploy-workflow-ci | |
# sudo mv result /var/coggiebot | |
# # - run: | | |
# # set -ex | |
# # while read -r line; do | |
# # if [[ $line == "migrating finished" ]]; then | |
# # echo "Migration completed!" | |
# # exit 0 | |
# # elif [[ $line == "coggiebotd-update.service: Succeeded" ]]; then | |
# # exit 1 | |
# # fi | |
# # done < $(sudo journalctl -fu coggiebotd-update.service) | |
# # - run: systemctl status coggiebotd.service | |
# # - run: systemctl status coggiebotd-update.timer | |
# # - name: "get version info" | |
# # id: rollover_info | |
# # run: | | |
# # echo "COG_REV=$(/var/coggiebot/result/coggiebot --built-from --token '')" >> $GITHUB_OUTPUT | |
# # echo "GIT_REV=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT | |
# # - run: echo "COG ${{ steps.rollover_info.outputs.COG_REV }}" | |
# # - run: echo "GIT ${{ steps.rollover_info.outputs.GIT_REV }}" | |
# # - name: "verify version is correct" | |
# # if: ${{ steps.rollover_info.outputs.COG_REV != steps.rullover_info.outputs.GIT_REV }} | |
# # run: exit 1 |