Cannot run actions on a host environment

I have been using gitea 1.21.4 hosting my code repositories on a CentOS 7.9 server. But when I set up a Gitea Actions’ runner using label linux_amd64:host, the runner actions do not seem to commit at all.

Well, it looks like every line of code has operated without any error, but it doesn’t commit copying files and compile sphinx docs on the server. Following is my yaml file for a sample repo:

name: MIL CI & CD

on:
  push:
    branches:
      - master

env:
  BARE_REPO_DIR: /var/lib/gitea/data/gitea-repositories/pma/pma-mil.git
  CLONED_REPO_DIR: /var/lib/gitea/data/gitea-repositories/pma/pma-mil
  DEPLOYED_DIR: /var/www/html/PMA/PMA-MIL

jobs:
  build:
    name: Build documentation
    runs-on: linux_amd64
    steps:
      - name: Clone
        run: |
          echo ${{ secrets.QXD_PASSWORD }} > su ${{ vars.QXD_USERID }}
          echo ${{ secrets.QXD_PASSWORD }} > sudo rm -rf $CLONED_REPO_DIR
          echo ${{ secrets.QXD_PASSWORD }} > sudo git clone $BARE_REPO_DIR $CLONED_REPO_DIR

      - name: Configure
        run: |
          echo ${{ secrets.QXD_PASSWORD }} > sudo cd $CLONED_REPO_DIR
          echo ${{ secrets.QXD_PASSWORD }} > sudo ls -la $CLONED_REPO_DIR
          echo ${{ secrets.QXD_PASSWORD }} > sudo git submodule init
          echo ${{ secrets.QXD_PASSWORD }} > sudo git submodule update
          echo ${{ secrets.QXD_PASSWORD }} > sudo python3 -m pip install -r requirements.txt

      - name: Build
        run: |
          echo ${{ secrets.QXD_PASSWORD }} > sudo make html

  deploy:
    name: Deploy documentation
    runs-on: linux_amd64
    needs: Build documentation
    steps:
      - name: Deploy
        run: |
          echo ${{ secrets.QXD_PASSWORD }} > sudo rm -rf $DEPLOYED_DIR/*
          echo ${{ secrets.QXD_PASSWORD }} > sudo cp -rf $CLONED_REPO_DIR/build/html/* $DEPLOYED_DIR/

Notice that I have set up secrets for passwords and so on. And I cannot find a way not using sudo to cp files to a system directory, otherwise there will be permission denied errors.

I didn’t try to use a docker image is because my network environment requires proxy settings to download stuffs from the internet, but I can neither find a way to set it. What should I do to make actions work on the host?

Does this relate to the CentOS v7.9 I was using?