|
1 | | -name: "2. Deploy docs to GitHub Pages" |
| 1 | +name: "3. CI/CD deploy" |
2 | 2 |
|
3 | 3 | on: |
4 | 4 | workflow_run: |
@@ -65,84 +65,84 @@ jobs: |
65 | 65 | echo "terraform_version=$(grep "^terraform\s" .tool-versions | cut -f2 -d' ')" >> $GITHUB_OUTPUT |
66 | 66 | echo "version=$(head -n 1 .version 2> /dev/null || echo unknown)" >> $GITHUB_OUTPUT |
67 | 67 | # echo "tag=${{ github.event.inputs.tag }}" >> $GITHUB_OUTPUT |
68 | | - - name: "List variables" |
69 | | - run: | |
70 | | - export BUILD_DATETIME="${{ steps.variables.outputs.build_datetime }}" |
71 | | - export BUILD_TIMESTAMP="${{ steps.variables.outputs.build_timestamp }}" |
72 | | - export BUILD_EPOCH="${{ steps.variables.outputs.build_epoch }}" |
73 | | - export NODEJS_VERSION="${{ steps.variables.outputs.nodejs_version }}" |
74 | | - export PYTHON_VERSION="${{ steps.variables.outputs.python_version }}" |
75 | | - export TERRAFORM_VERSION="${{ steps.variables.outputs.terraform_version }}" |
76 | | - export VERSION="${{ steps.variables.outputs.version }}" |
77 | | - # export TAG="${{ steps.variables.outputs.tag }}" |
78 | | - make list-variables |
79 | | -
|
80 | | - deploy-jekyll: |
81 | | - environment: |
82 | | - name: github-pages |
83 | | - url: ${{ steps.deployment.outputs.page_url }} |
84 | | - runs-on: ubuntu-latest |
85 | | - needs: metadata |
86 | | - steps: |
87 | | - - name: "Checkout code" |
88 | | - uses: actions/checkout@v5 |
89 | | - |
90 | | - - name: "Get version" |
91 | | - id: get-asset-version |
92 | | - shell: bash |
93 | | - env: |
94 | | - GH_TOKEN: ${{ github.token }} |
95 | | - run: | |
96 | | - INPUTS_INCLUDE_PRERELEASES="${{ inputs.include_prereleases }}" |
97 | | - INPUTS_INCLUDE_PRERELEASES=${INPUTS_INCLUDE_PRERELEASES:-"true"} |
98 | | -
|
99 | | - INPUTS_VERSION="${{ inputs.version }}" |
100 | | - INPUTS_VERSION=${INPUTS_VERSION:-"latest"} |
101 | | -
|
102 | | -
|
103 | | - if [[ $INPUTS_INCLUDE_PRERELEASES == true ]]; then |
104 | | - json=$(gh release list --json tagName --limit 1 --exclude-drafts) |
105 | | - else |
106 | | - json=$(gh release list --json tagName --limit 1 --exclude-drafts --exclude-pre-releases) |
107 | | - fi |
108 | | -
|
109 | | - echo "Release list response: $json" |
110 | | -
|
111 | | - # Check if the response is empty |
112 | | - if [[ "$json" == "[]" ]] || [[ -z "$json" ]]; then |
113 | | - echo "::error::No releases found. Please create a release before deploying docs." |
114 | | - exit 1 |
115 | | - fi |
116 | | -
|
117 | | - release_version=$(echo $json | jq -r '.[0].tagName') |
118 | | - if [[ "$release_version" == "null" ]] || [[ -z "$release_version" ]]; then |
119 | | - echo "::error::Could not extract release version from: $json" |
120 | | - exit 1 |
121 | | - fi |
122 | | -
|
123 | | - echo "Found release version: $release_version" |
124 | | -
|
125 | | - if [[ $INPUTS_VERSION == latest ]]; then |
126 | | - echo "release_version=$release_version" >> $GITHUB_OUTPUT |
127 | | - else |
128 | | - echo "release_version=$INPUTS_VERSION" >> $GITHUB_OUTPUT |
129 | | - fi |
130 | | -
|
131 | | - - name: "Get release version" |
132 | | - id: download-asset |
133 | | - shell: bash |
134 | | - env: |
135 | | - GH_TOKEN: ${{ github.token }} |
136 | | - run: | |
137 | | - gh release download ${{steps.get-asset-version.outputs.release_version}} -p jekyll-docs-*.tar --output artifact.tar |
138 | | -
|
139 | | - - uses: actions/upload-artifact@v4 |
140 | | - with: |
141 | | - name: jekyll-docs-${{steps.get-asset-version.outputs.release_version}} |
142 | | - path: artifact.tar |
143 | | - |
144 | | - - name: Deploy to GitHub Pages |
145 | | - id: deployment |
146 | | - uses: actions/deploy-pages@v4 |
147 | | - with: |
148 | | - artifact_name: jekyll-docs-${{steps.get-asset-version.outputs.release_version}} |
| 68 | + # - name: "List variables" |
| 69 | + # run: | |
| 70 | + # export BUILD_DATETIME="${{ steps.variables.outputs.build_datetime }}" |
| 71 | + # export BUILD_TIMESTAMP="${{ steps.variables.outputs.build_timestamp }}" |
| 72 | + # export BUILD_EPOCH="${{ steps.variables.outputs.build_epoch }}" |
| 73 | + # export NODEJS_VERSION="${{ steps.variables.outputs.nodejs_version }}" |
| 74 | + # export PYTHON_VERSION="${{ steps.variables.outputs.python_version }}" |
| 75 | + # export TERRAFORM_VERSION="${{ steps.variables.outputs.terraform_version }}" |
| 76 | + # export VERSION="${{ steps.variables.outputs.version }}" |
| 77 | + # # export TAG="${{ steps.variables.outputs.tag }}" |
| 78 | + # make list-variables |
| 79 | + |
| 80 | + # deploy-jekyll: |
| 81 | + # environment: |
| 82 | + # name: github-pages |
| 83 | + # url: ${{ steps.deployment.outputs.page_url }} |
| 84 | + # runs-on: ubuntu-latest |
| 85 | + # needs: metadata |
| 86 | + # steps: |
| 87 | + # - name: "Checkout code" |
| 88 | + # uses: actions/checkout@v5 |
| 89 | + |
| 90 | + # - name: "Get version" |
| 91 | + # id: get-asset-version |
| 92 | + # shell: bash |
| 93 | + # env: |
| 94 | + # GH_TOKEN: ${{ github.token }} |
| 95 | + # run: | |
| 96 | + # INPUTS_INCLUDE_PRERELEASES="${{ inputs.include_prereleases }}" |
| 97 | + # INPUTS_INCLUDE_PRERELEASES=${INPUTS_INCLUDE_PRERELEASES:-"true"} |
| 98 | + |
| 99 | + # INPUTS_VERSION="${{ inputs.version }}" |
| 100 | + # INPUTS_VERSION=${INPUTS_VERSION:-"latest"} |
| 101 | + |
| 102 | + |
| 103 | + # if [[ $INPUTS_INCLUDE_PRERELEASES == true ]]; then |
| 104 | + # json=$(gh release list --json tagName --limit 1 --exclude-drafts) |
| 105 | + # else |
| 106 | + # json=$(gh release list --json tagName --limit 1 --exclude-drafts --exclude-pre-releases) |
| 107 | + # fi |
| 108 | + |
| 109 | + # echo "Release list response: $json" |
| 110 | + |
| 111 | + # # Check if the response is empty |
| 112 | + # if [[ "$json" == "[]" ]] || [[ -z "$json" ]]; then |
| 113 | + # echo "::error::No releases found. Please create a release before deploying docs." |
| 114 | + # exit 1 |
| 115 | + # fi |
| 116 | + |
| 117 | + # release_version=$(echo $json | jq -r '.[0].tagName') |
| 118 | + # if [[ "$release_version" == "null" ]] || [[ -z "$release_version" ]]; then |
| 119 | + # echo "::error::Could not extract release version from: $json" |
| 120 | + # exit 1 |
| 121 | + # fi |
| 122 | + |
| 123 | + # echo "Found release version: $release_version" |
| 124 | + |
| 125 | + # if [[ $INPUTS_VERSION == latest ]]; then |
| 126 | + # echo "release_version=$release_version" >> $GITHUB_OUTPUT |
| 127 | + # else |
| 128 | + # echo "release_version=$INPUTS_VERSION" >> $GITHUB_OUTPUT |
| 129 | + # fi |
| 130 | + |
| 131 | + # - name: "Get release version" |
| 132 | + # id: download-asset |
| 133 | + # shell: bash |
| 134 | + # env: |
| 135 | + # GH_TOKEN: ${{ github.token }} |
| 136 | + # run: | |
| 137 | + # gh release download ${{steps.get-asset-version.outputs.release_version}} -p jekyll-docs-*.tar --output artifact.tar |
| 138 | + |
| 139 | + # - uses: actions/upload-artifact@v4 |
| 140 | + # with: |
| 141 | + # name: jekyll-docs-${{steps.get-asset-version.outputs.release_version}} |
| 142 | + # path: artifact.tar |
| 143 | + |
| 144 | + # - name: Deploy to GitHub Pages |
| 145 | + # id: deployment |
| 146 | + # uses: actions/deploy-pages@v4 |
| 147 | + # with: |
| 148 | + # artifact_name: jekyll-docs-${{steps.get-asset-version.outputs.release_version}} |
0 commit comments