diff --git a/.woodpecker.yml b/.woodpecker.yml index c0619db..ce4df9b 100644 --- a/.woodpecker.yml +++ b/.woodpecker.yml @@ -4,11 +4,6 @@ pipeline: when: event: [ push, pull_request, tag, deployment ] commands: - - git config --global user.email "$CI_COMMIT_AUTHOR_EMAIL" - - git config --global user.name "$CI_COMMIT_AUTHOR" - make env - make - - ./scripts/zola.sh deploy pages public "$CI_COMMIT_AUTHOR <$CI_COMMIT_AUTHOR_EMAIL>" - - ./scripts/ci.sh --init $HOSTEA_WRITE_DEPLOY_KEY - - ./scripts/ci.sh --deploy $PAGES_DEPLOY_SECRET pages - - ./scripts/ci.sh --clean + - make ci-deploy diff --git a/Makefile b/Makefile index 790c01e..285581e 100644 --- a/Makefile +++ b/Makefile @@ -5,6 +5,14 @@ default: ## Build the website clean: ## Clean build assets ./scripts/zola.sh clean +ci-deploy: ## Deploy from CI/CD. Only call from within CI + git config --global user.email "${CI_COMMIT_AUTHOR_EMAIL}" + git config --global user.name "${CI_COMMIT_AUTHOR}" + ./scripts/zola.sh deploy pages public "${CI_COMMIT_AUTHOR} <${CI_COMMIT_AUTHOR_EMAIL}>" + ./scripts/ci.sh --init ${HOSTEA_WRITE_DEPLOY_KEY} + ./scripts/ci.sh --deploy ${PAGES_DEPLOY_SECRET} pages + ./scripts/ci.sh --clean + env: ## Download build dependencies and setup dev environement ./scripts/zola.sh install