npm i -g netlify-cli.zshrc as export NETLIFY_AUTH_TOKEN=thetokenzshrc: source .zshrcnetlify init in your repobuild or _site)netlify deploy --prodMake your CI file (ex: codefresh.yml). Make sure you add your personal access token to the environment as NETLIFY_AUTH_TOKEN. Also get the NETLIFY_SITE_ID from Settings > General > Site details > Site information > API ID, and save to NETLIFY_SITE_ID
version: "1.0"
stages:
- "clone"
- "release"
steps:
clone:
title: "Cloning repository"
type: "git-clone"
repo: "$/$"
revision: "$"
git: "github"
stage: "clone"
release:
title: Release new version and add to changelog
stage: "release"
type: freestyle
working_directory: "./$"
arguments:
image: "node:latest"
commands:
- yarn
# So it doesn't ask for fingerprint
- mkdir ~/.ssh/ && echo -e "Host github.com\n\tStrictHostKeyChecking no\n" > ~/.ssh/config
- yarn add netlify-cli @11ty/eleventy
- yarn semantic-release
- yarn build
- yarn run netlify deploy --prod
when:
branch:
only:
- master