Gitlab CI/CD:发布构建阶段的结果到另一个阶段



我正在用Gitlab CI/CD构建一个CI/CD管道。

.gitlab-ci.yml-

build:
image: node:16-alpine
stage: build
script:
- yarn install
- yarn build
artifacts:
paths:
- //something here

我有一个构建应用程序的build作业。在部署应用程序的下一个作业中,我需要从以前的工作build的构建目录。

我如何将其作为工件发布?

我做

needs:
- job: "build"
artifacts: true
stage: release
image: registry.gitlab.com/gitlab-org/release-cli:latest #docker image
script:
- echo "release job"
release:
name: 'Release Executables $CI_COMMIT_SHORT_SHA'
description: 'Created using the release-cli'
tag_name: '$CI_COMMIT_SHORT_SHA'
assets:
links:
- name: 'comment one'
url: 'https://my.gitlab.my/you/project/-/jobs/${GE_JOB_ID}/artifacts/path to file'

结果搜索释放!

相关内容

最新更新