我创建了一个 Gitlab CI 作业,用于pandoc
创建一些我想部署到使用 Gitlab Pages 托管的 Hugo 站点的 HTML 和 PDF 资产。
在.gitlab-ci.yml
我的工作中是这样的:
# All available Hugo versions are listed here: https://gitlab.com/pages/hugo/container_registry
stages:
- test
- deploy
- build
variables:
GIT_SUBMODULE_STRATEGY: recursive
test:
image: registry.gitlab.com/pages/hugo:latest
stage: test
script:
- hugo
except:
- master
assets:
stage: build
image:
name: pandoc/latex:2.6
entrypoint: ["/bin/sh", "-c"]
before_script:
- apk add bash
- apk add zip
- chmod +x ci-build.sh
script:
- ./ci-build.sh
artifacts:
paths:
- public
pages:
image: registry.gitlab.com/pages/hugo:latest
stage: deploy
script:
- hugo
artifacts:
paths:
- public
only:
- master
但是,此作业生成的资产似乎没有部署到我的站点,因为我在尝试访问它们时收到 404。
我尝试设置工件路径,但收到此错误:
artifacts:
paths:
- public
Uploading artifacts...
public: found 369 matching files
Uploading artifacts to coordinator... ok id=281690834 responseStatus=201 Created token=56oqTg7A
Job succeeded
我真的很想弄清楚这一点,这样我就不必在 Git 中跟踪资产。非常感激任何的帮助!