GitHub 작업을 사용하여 웹 사이트를 Neocities에 효율적으로 배포하십시오. 컨텐츠 인식 차이를 사용하여 변경된 파일 만 업데이트합니다.
또는 비동기 신호에서 빈 헬퍼를 사용하여 CI뿐만 아니라 자신의 컴퓨터에서 로컬로 신생에 배치 할 수 있습니다.
name : Deploy to neocities
# only run on changes to main. Use main or master depending on whatever your default branch is called.
on :
push :
branches :
- main
concurrency : # prevent concurrent deploys doing strange things
group : deploy-to-neocities
cancel-in-progress : true
jobs :
deploy :
runs-on : ubuntu-latest
steps :
- uses : actions/checkout@v4
# Set up any tools and build steps here
# This example uses a Node.js toolchain to build a site
- name : Use Node.js
uses : actions/setup-node@v4
with :
node-version : lts/*
# If you have a different build process, replace this with your own build steps
- name : Install deps and build
run : |
npm i
npm run build
# When the dist_dir is ready, deploy it to neocities
- name : Deploy to neocities
uses : bcomnes/deploy-to-neocities@v3
with :
api_key : ${{ secrets.NEOCITIES_API_TOKEN }}
cleanup : false
neocities_supporter : false # set this to true if you have a supporter account and want to bypass unsuported files filter.
preview_before_deploy : true # print a deployment plan prior to waiting for files to upload.
dist_dir : public
저장소의 .github/workflows
디렉토리에서 워크 플로 .yml
파일을 만듭니다. 예제 워크 플로가 위에 사용 가능합니다. 자세한 내용은 워크 플로 파일 생성을위한 Github 도움말 설명서를 참조하십시오.
귀하의 사이트에는 API 토큰이 필요합니다. 이동 :
https://neocities.org/settings/{{your-sitename}}#api_key
사이트의 API 토큰을 얻으십시오. Github 저장소에서 NEOCITIES_API_TOKEN
이라는 비밀을 설정하십시오. deploy-to-neocities
action의 api_token
입력을 위의 예에서와 같이 ${{ secrets.NEOCITIES_API_TOKEN }}
로 설정하십시오.
워크 플로우 중에 Neocities에 디렉토리에 배포하려는 파일을 생성하십시오. 이것을 워크 플로에서 dist_dir
디렉토리로 설정하십시오 (기본값은 public
). 모든 도구를 사용하여 GitHub 액션 환경에 설치하거나 가져올 수있는 사이트를 생성 할 수 있습니다.
빌드가 완료되면 deploy-to-neocities
모든 신규 및 모든 변경된 파일이 신경에 효율적으로 업로드됩니다. dist_dir
에 존재하지 않는 신성에 관한 파일은 '고아'파일로 간주됩니다. 이 '고아'파일을 파괴적으로 제거하려면 cleanup
입력을 true
로 설정하십시오.
당신은 아마도 master
브랜치에서만 실행하기를 원하므로 웹 사이트 업데이트에서 master
결과에만 최선을 다하겠습니다. 모든 지점 및 PR에 배포되지 않는 테스트 빌드를 실행하면 빌드를 깨뜨릴 변경을 포착하는 데 도움이 될 수 있습니다.
api_key
( 필수 ) : NeoCities 웹 사이트를위한 API 토큰.dist_dir
: Neocities에 배포 할 디렉토리. 기본값 : public
. 루트 repo 디렉토리 (예 ./
)를 배포하지 마십시오. .git
, .github
및 Neocities에 제대로 배포되지 않는 다른 파일이 포함되어 있습니다. 사이트를 서브 디르로 보관하거나 구축하여 깨끗하게 유지하고 배치하십시오.neocoties_supporter
: 유료 Neocities 계정이 있고 지원되지 않는 파일 필터를 우회하려는 경우 이것을 true
로 설정하십시오.cleanup
: 부울 문자열 ( true
또는 false
). true
이라면 dist_dir
에서 찾을 수없는 deploy-to-neocities
파일을 삭제합니다. 기본값 : false
.preview_before_deploy
: 부울 문자열 ( true
또는 false
). true
인 경우, deploy-to-neocities
업로드 및 삭제 될 파일의 미리보기를 인쇄합니다. 기본값 : true
.protected_files
: 파일을 보호 된 것으로 표시하는 데 사용되는 옵션 글로벌 문자열. 보호 파일은 정리되지 않습니다. 의존하기 전에 cleanup
설정 으로이 옵션을 테스트하십시오. 정리 파일은 cleanup
true 또는 false로 설정되면 인쇄됩니다. 글로벌 문자열은 원격 신경 파일 경로에 대한 최소치로 처리됩니다. 보호 된 파일은 여전히 업데이트 될 수 있습니다.없음.
Neocities는 많은 좋은 속성을 제공합니다.
A
와 AAAA
레코드 만 있으면됩니다. 맨 이름과 모두!changelog.md를 참조하십시오