|
| 1 | +# |
| 2 | +# Licensed to the Apache Software Foundation (ASF) under one or more |
| 3 | +# contributor license agreements. See the NOTICE file distributed with |
| 4 | +# this work for additional information regarding copyright ownership. |
| 5 | +# The ASF licenses this file to you under the Apache License, Version 2.0 |
| 6 | +# (the "License"); you may not use this file except in compliance with |
| 7 | +# the License. You may obtain a copy of the License at |
| 8 | +# |
| 9 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | +# |
| 11 | +# Unless required by applicable law or agreed to in writing, software |
| 12 | +# distributed under the License is distributed on an "AS IS" BASIS, |
| 13 | +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 14 | +# See the License for the specific language governing permissions and |
| 15 | +# limitations under the License. |
| 16 | +# |
| 17 | + |
| 18 | +name: deploy-site |
| 19 | + |
| 20 | +on: |
| 21 | + push: |
| 22 | + branches: |
| 23 | + - "2.x" |
| 24 | + - "2.x-site-pro" |
| 25 | + - "release/*" |
| 26 | + paths-ignore: |
| 27 | + - "**.md" |
| 28 | + - "**.txt" |
| 29 | + |
| 30 | +permissions: read-all |
| 31 | + |
| 32 | +jobs: |
| 33 | + |
| 34 | + deploy-site-stg: |
| 35 | + if: github.repository == 'apache/logging-log4j2' && github.ref_name == '2.x' |
| 36 | + uses: apache/logging-parent/.github/workflows/deploy-site-reusable.yaml@main |
| 37 | + # Secrets for committing the generated site |
| 38 | + secrets: |
| 39 | + GPG_SECRET_KEY: ${{ secrets.LOGGING_GPG_SECRET_KEY }} |
| 40 | + # Write permissions for committing the generated site |
| 41 | + permissions: |
| 42 | + contents: write |
| 43 | + with: |
| 44 | + asf-yaml-content: | |
| 45 | + staging: |
| 46 | + profile: ~ |
| 47 | + whoami: ${{ github.ref_name }}-site-stg-out |
| 48 | + subdir: content/log4j/2.x |
| 49 | + install-required: true |
| 50 | + target-branch: ${{ github.ref_name }}-site-stg-out |
| 51 | + |
| 52 | + deploy-site-pro: |
| 53 | + if: github.repository == 'apache/logging-log4j2' && github.ref_name == '2.x-site-pro' |
| 54 | + uses: apache/logging-parent/.github/workflows/deploy-site-reusable.yaml@main |
| 55 | + # Secrets for committing the generated site |
| 56 | + secrets: |
| 57 | + GPG_SECRET_KEY: ${{ secrets.LOGGING_GPG_SECRET_KEY }} |
| 58 | + # Write permissions for committing the generated site |
| 59 | + permissions: |
| 60 | + contents: write |
| 61 | + with: |
| 62 | + asf-yaml-content: | |
| 63 | + publish: |
| 64 | + profile: ~ |
| 65 | + whoami: ${{ github.ref_name }}-out |
| 66 | + subdir: content/log4j/2.x |
| 67 | + install-required: true |
| 68 | + target-branch: ${{ github.ref_name }}-out |
| 69 | + |
| 70 | + export-version: |
| 71 | + if: github.repository == 'apache/logging-log4j2' && startsWith(github.ref_name, 'release/') |
| 72 | + runs-on: ubuntu-latest |
| 73 | + outputs: |
| 74 | + version: ${{ steps.export-version.outputs.version }} |
| 75 | + steps: |
| 76 | + - name: Export version |
| 77 | + id: export-version |
| 78 | + run: | |
| 79 | + version=$(echo "${{ github.ref_name }}" | sed 's/^release\///') |
| 80 | + echo "version=$version" >> "$GITHUB_OUTPUT" |
| 81 | +
|
| 82 | + deploy-site-rel: |
| 83 | + needs: export-version |
| 84 | + uses: apache/logging-parent/.github/workflows/deploy-site-reusable.yaml@main |
| 85 | + # Secrets for committing the generated site |
| 86 | + secrets: |
| 87 | + GPG_SECRET_KEY: ${{ secrets.LOGGING_GPG_SECRET_KEY }} |
| 88 | + # Write permissions for committing the generated site |
| 89 | + permissions: |
| 90 | + contents: write |
| 91 | + with: |
| 92 | + asf-yaml-content: | |
| 93 | + staging: |
| 94 | + profile: ~ |
| 95 | + whoami: ${{ github.ref_name }}-site-stg-out |
| 96 | + subdir: content/log4j/${{ needs.export-version.outputs.version }} |
| 97 | + install-required: true |
| 98 | + target-branch: ${{ github.ref_name }}-site-stg-out |
0 commit comments