fix(workflow): simplified workflow and removed a bunch of echos

This commit is contained in:
Seaswimmer 2024-01-07 12:49:44 +00:00
parent 22e20abe1f
commit 7bf7988617
Signed by untrusted user: cswimr
GPG key ID: D74DDDDF420E13DF

View file

@ -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