From 7bf7988617f4f949ae434a35cbec463e7cabd6a2 Mon Sep 17 00:00:00 2001 From: SeaswimmerTheFsh Date: Sun, 7 Jan 2024 12:49:44 +0000 Subject: [PATCH] fix(workflow): simplified workflow and removed a bunch of echos --- .forgejo/workflows/workflow.yaml | 31 +++++++------------------------ 1 file changed, 7 insertions(+), 24 deletions(-) diff --git a/.forgejo/workflows/workflow.yaml b/.forgejo/workflows/workflow.yaml index 1f244e9..f2d54a0 100644 --- a/.forgejo/workflows/workflow.yaml +++ b/.forgejo/workflows/workflow.yaml @@ -15,10 +15,6 @@ jobs: with: fetch-depth: 0 - - uses: actions/env@v2 - - name: Set branch name - run: echo "BRANCH=$CI_ACTION_REF_NAME_SLUG" >> $GITHUB_ENV - - name: Install dependencies run: poetry install --with docs --with dev --no-root @@ -26,6 +22,9 @@ jobs: run: mkdocs build continue-on-error: true + - name: Set Environment Variables + uses: actions/env@v2 + - name: Deploy the documentation to Meli (CoastalCommits Pages) run: | GREEN='\033[0;32m' @@ -35,32 +34,16 @@ jobs: unset GITHUB_TOKEN unset GITLAB_TOKEN - - echo "branch = ${{ env.BRANCH }}" - echo "github.ref = ${{ github.ref }}" - echo "github.base_ref = ${{ github.base_ref }}" - echo "github.ref_name = ${{ github.ref_name }}" - echo "(Basename) branch = $(basename "${{ env.BRANCH }}")" - echo "(Basename) github.ref = $(basename "${{ github.ref }}")" - echo "(Basename) github.base_ref = $(basename "${{ github.base_ref }}")" - echo "(Basename) github.ref_name = $(basename "${{ github.ref_name }}")" - - if [ -n "${{ github.base_ref }}" ]; then - release="$(basename "${{ github.base_ref }}")" - else - release="$(basename "${{ github.ref }}")" - fi - - echo "${YELLOW}Deploying to ${BLUE}Meli ${YELLOW}on branch ${GREEN}$release${YELLOW}...\n" + echo "${YELLOW}Deploying to ${BLUE}Meli ${YELLOW}on branch ${GREEN}$CI_ACTION_REF_NAME_SLUG${YELLOW}...\n" npx -p "@getmeli/cli" meli upload ./site \ --url "https://pages.coastalcommits.com" \ --site "${{ vars.MELI_SITE_ID }}" \ --token "${{ secrets.MELI_SITE_SECRET }}" \ - --release "$release/$(git rev-parse HEAD)" \ - --branch "$release" + --release "$CI_ACTION_REF_NAME_SLUG/$(git rev-parse HEAD)" \ + --branch "$CI_ACTION_REF_NAME_SLUG" - echo "\n${YELLOW}Deployed to ${BLUE}Meli ${YELLOW}on branch ${GREEN}$release${YELLOW}!" + echo "\n${YELLOW}Deployed to ${BLUE}Meli ${YELLOW}on branch ${GREEN}$CI_ACTION_REF_NAME_SLUG${YELLOW}!" env: GITEA_TOKEN: ${{ secrets.COASTALCOMMITSTOKEN }} continue-on-error: true