Skip to content

Commit b04ef1c

Browse files
Add docs publish in.
1 parent 9086d21 commit b04ef1c

File tree

2 files changed

+91
-0
lines changed

2 files changed

+91
-0
lines changed

.github/workflows/cicd-1-pull-request.yaml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,3 +127,18 @@ jobs:
127127
terraform_version: "${{ needs.metadata.outputs.terraform_version }}"
128128
version: "${{ needs.metadata.outputs.version }}"
129129
secrets: inherit
130+
publish-stage: # Recommended maximum execution time is 10 minutes
131+
name: "Publish stage"
132+
needs: [metadata, acceptance-stage]
133+
uses: ./.github/workflows/stage-5-publish.yaml
134+
if: (github.event_name == 'push' && github.ref == 'refs/heads/main')
135+
with:
136+
build_datetime: "${{ needs.metadata.outputs.build_datetime }}"
137+
build_timestamp: "${{ needs.metadata.outputs.build_timestamp }}"
138+
build_epoch: "${{ needs.metadata.outputs.build_epoch }}"
139+
nodejs_version: "${{ needs.metadata.outputs.nodejs_version }}"
140+
python_version: "${{ needs.metadata.outputs.python_version }}"
141+
terraform_version: "${{ needs.metadata.outputs.terraform_version }}"
142+
version: "${{ needs.metadata.outputs.version }}"
143+
is_version_prerelease: "${{ needs.metadata.outputs.is_version_prerelease }}"
144+
secrets: inherit
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
name: "Publish stage"
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
build_datetime:
7+
description: "Build datetime, set by the CI/CD pipeline workflow"
8+
required: true
9+
type: string
10+
build_timestamp:
11+
description: "Build timestamp, set by the CI/CD pipeline workflow"
12+
required: true
13+
type: string
14+
build_epoch:
15+
description: "Build epoch, set by the CI/CD pipeline workflow"
16+
required: true
17+
type: string
18+
nodejs_version:
19+
description: "Node.js version, set by the CI/CD pipeline workflow"
20+
required: true
21+
type: string
22+
python_version:
23+
description: "Python version, set by the CI/CD pipeline workflow"
24+
required: true
25+
type: string
26+
terraform_version:
27+
description: "Terraform version, set by the CI/CD pipeline workflow"
28+
required: true
29+
type: string
30+
version:
31+
description: "Version of the software, set by the CI/CD pipeline workflow"
32+
required: true
33+
type: string
34+
is_version_prerelease:
35+
description: "Is this a semantically versioned pre release, set by the CI/CD pipeline workflow"
36+
required: true
37+
type: string
38+
jobs:
39+
publish:
40+
name: "Publish packages"
41+
runs-on: ubuntu-latest
42+
timeout-minutes: 10
43+
44+
steps:
45+
- name: "Checkout code"
46+
uses: actions/checkout@v4
47+
48+
- name: "Get the artefacts 1"
49+
uses: actions/download-artifact@v4
50+
with:
51+
path: ./artifacts/jekyll-docs-${{ inputs.version }}
52+
name: jekyll-docs-${{ inputs.version }}
53+
54+
- name: "Create release"
55+
id: create_release
56+
uses: actions/create-release@v1
57+
env:
58+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
59+
with:
60+
tag_name: ${{ inputs.version }}
61+
release_name: ${{ inputs.version }}
62+
body: |
63+
Release of ${{ inputs.version }}
64+
draft: false
65+
prerelease: ${{ inputs.is_version_prerelease == 'true'}}
66+
67+
68+
- name: "Upload jeykll docs release asset"
69+
uses: actions/upload-release-asset@v1
70+
env:
71+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
72+
with:
73+
upload_url: "${{ steps.create_release.outputs.upload_url }}"
74+
asset_path: ./artifacts/jekyll-docs-${{ inputs.version }}/artifact.tar
75+
asset_name: jekyll-docs-${{ inputs.version }}.tar
76+
asset_content_type: "application/gzip"

0 commit comments

Comments
 (0)