From 051e61ef17cc53947e60d2adce97ad2e5895601e Mon Sep 17 00:00:00 2001 From: mac-a-r0ni <1995739+mac-a-r0ni@users.noreply.github.com> Date: Tue, 7 Jan 2025 16:01:04 -0500 Subject: [PATCH] Create deploy.yml --- .github/workflows/deploy.yml | 46 ++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 .github/workflows/deploy.yml diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..72a64c1 --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,46 @@ +name: deploy + +on: + push: + branches: + - '*' + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +jobs: + build: + runs-on: ubuntu-latest + + steps: + # Checks-out your repository under $GITHUB_WORKSPACE + - uses: actions/checkout@v3 + + # Prepare git log message to avoid extra blank lines + - name: Set env message + run: | + GITREPO=`git remote show origin -n | grep h.URL | sed 's/Fetch URL: https:\/\/github.com\/crux-arm\///g'` + GITMSG=`git log -1 --pretty=format:"%s"` + echo "MESSAGE=$(echo "[$GITREPO ]: $GITMSG")" >> $GITHUB_ENV + + # Send IRC message by bot + - name: irc push + uses: rectalogic/notify-irc@v1 + if: github.event_name == 'push' && !contains(github.event.head_commit.message, 'REPO') + with: + channel: "#crux-arm" + server: "irc.libera.chat" + nickname: crux-arm-bot + message: ${{ env.MESSAGE }} + + - name: Update REPO file + run: | + wget -P /tmp -q https://crux.nu/files/httpup-0.5.0.tar.xz + tar -C /tmp -xf /tmp/httpup-0.5.0.tar.xz httpup-0.5.0/httpup-repgen + /tmp/httpup-0.5.0/httpup-repgen + git add REPO + + - name: Push to remote + run: | + git config user.name "$(git log -n 1 --pretty=format:%an)" + git config user.email "$(git log -n 1 --pretty=format:%ae)" + bash -c "git commit -a -m '[auto] Update REPO file' && git push || exit 0"