From bc6bb5a53aa1096a39c2b0c265c5cd8f78d92bb8 Mon Sep 17 00:00:00 2001 From: malnozili <98384244+malnozili@users.noreply.github.com> Date: Wed, 6 Dec 2023 21:27:12 +0300 Subject: [PATCH] Update setup_site.yml --- .github/workflows/setup_site.yml | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/.github/workflows/setup_site.yml b/.github/workflows/setup_site.yml index c254bc0e..71596761 100644 --- a/.github/workflows/setup_site.yml +++ b/.github/workflows/setup_site.yml @@ -14,7 +14,26 @@ on: # - completed jobs: - setup_sites: + which_branch: + runs-on: ubuntu-latest + steps: + # extract branch name + - name: Extract branch name + if: github.event_name != 'pull_request' + shell: bash + run: echo "::set-env name=BRANCH_NAME::$(echo ${GITHUB_REF#refs/heads/})" + id: extract_branch + + # extract branch name on pull request + - name: Print branch name + if: github.event_name == 'pull_request' + run: echo "::set-env name=BRANCH_NAME::$(echo ${GITHUB_HEAD_REF})" + + # print branch name + - name: Get branch name + run: echo 'The branch name is' $BRANCH_NAME + + setup_sites: runs-on: - self-hosted @@ -24,6 +43,7 @@ jobs: uses: actions/checkout@v2 - name: Create first bench run: | + echo 'The branch name is' $BRANCH_NAME cp example.env ~/gitopss/erpnext-one.env sed -i 's/DB_PASSWORD=123/DB_PASSWORD=fintech2023/g' ~/gitopss/erpnext-one.env sed -i 's/DB_HOST=/DB_HOST=mariadb-database/g' ~/gitopss/erpnext-one.env