Better release flow
This commit is contained in:
+8
-8
@@ -2,6 +2,9 @@ stages:
|
|||||||
- Build
|
- Build
|
||||||
- Release
|
- Release
|
||||||
|
|
||||||
|
variables:
|
||||||
|
PACKAGE_URL: "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/naturvardarna-site/${CI_COMMIT_TAG}/naturvardarna-site.zip"
|
||||||
|
|
||||||
"Build":
|
"Build":
|
||||||
stage: Build
|
stage: Build
|
||||||
image: node:alpine
|
image: node:alpine
|
||||||
@@ -10,24 +13,21 @@ stages:
|
|||||||
script:
|
script:
|
||||||
- npm ci
|
- npm ci
|
||||||
- npm run build
|
- npm run build
|
||||||
- apk add --no-cache zip
|
- apk add --no-cache zip curl
|
||||||
- cd dist && zip -r ../naturvardarna-site.zip . && cd ..
|
- cd dist && zip -r ../naturvardarna-site.zip . && cd ..
|
||||||
|
- 'curl --header "JOB-TOKEN: $CI_JOB_TOKEN" --upload-file naturvardarna-site.zip "${PACKAGE_URL}"'
|
||||||
artifacts:
|
artifacts:
|
||||||
paths:
|
paths:
|
||||||
- dist/
|
- dist/
|
||||||
- naturvardarna-site.zip
|
expire_in: 1 week
|
||||||
expire_in: 30 days
|
|
||||||
|
|
||||||
"Create Release":
|
"Create Release":
|
||||||
stage: Release
|
stage: Release
|
||||||
image: registry.gitlab.com/gitlab-org/release-cli:latest
|
image: registry.gitlab.com/gitlab-org/release-cli:latest
|
||||||
needs:
|
|
||||||
- job: Build
|
|
||||||
artifacts: true
|
|
||||||
rules:
|
rules:
|
||||||
- if: $CI_COMMIT_TAG
|
- if: $CI_COMMIT_TAG
|
||||||
script:
|
script:
|
||||||
- echo "Creating release for tag $CI_COMMIT_TAG"
|
- echo "Creating permanent release for tag $CI_COMMIT_TAG"
|
||||||
release:
|
release:
|
||||||
name: "Release $CI_COMMIT_TAG"
|
name: "Release $CI_COMMIT_TAG"
|
||||||
description: "Automated release of the Naturvärdarna static site."
|
description: "Automated release of the Naturvärdarna static site."
|
||||||
@@ -36,4 +36,4 @@ stages:
|
|||||||
assets:
|
assets:
|
||||||
links:
|
links:
|
||||||
- name: "Compiled Site (ZIP)"
|
- name: "Compiled Site (ZIP)"
|
||||||
url: "${CI_PROJECT_URL}/-/jobs/artifacts/${CI_COMMIT_TAG}/raw/naturvardarna-site.zip?job=build_site"
|
url: "$PACKAGE_URL"
|
||||||
|
|||||||
Reference in New Issue
Block a user