LPD-84161 Generated: buildLang #38
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| defaults: | |
| run: | |
| shell: bash | |
| jobs: | |
| publish-liferay-aws-bootstrap: | |
| if: ${{github.repository == 'liferay/liferay-portal'}} | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Authenticate to Google Cloud | |
| uses: google-github-actions/auth@v2 | |
| with: | |
| service_account: ${{secrets.GCP_SA}} | |
| workload_identity_provider: ${{secrets.GCP_WORKLOAD_IDENTITY_PROVIDER}} | |
| - name: Set up Google Cloud CLI | |
| uses: google-github-actions/setup-gcloud@v2 | |
| with: | |
| project_id: ${{secrets.GCP_PROJECT_ID}} | |
| - name: Set up variables | |
| run: | | |
| CURRENT_VERSION="$(jq -r '."liferay-aws-bootstrap"' ./cloud/scripts/versions.json)" | |
| echo "CURRENT_VERSION=${CURRENT_VERSION}" >> ${GITHUB_ENV} | |
| GCS_PATH="gs://liferay-cloud-native-bootstrap/bootstrap/liferay-aws-bootstrap/liferay-aws-bootstrap-${CURRENT_VERSION}.tar.gz" | |
| echo "GCS_PATH=${GCS_PATH}" >> ${GITHUB_ENV} | |
| - id: verify_version | |
| name: Verify version | |
| run: | | |
| if ! gsutil --quiet stat ${GCS_PATH} | |
| then | |
| echo "Verified version ${CURRENT_VERSION}." | |
| echo "CURRENT_VERSION=${CURRENT_VERSION}" >> ${GITHUB_ENV} | |
| echo "should_publish=true" >> ${GITHUB_OUTPUT} | |
| else | |
| echo "Version ${CURRENT_VERSION} already exists. Skipping publish." | |
| fi | |
| - if: ${{steps.verify_version.outputs.should_publish == 'true'}} | |
| name: Package and push AWS bootstrap scripts | |
| run: | | |
| tar \ | |
| --create \ | |
| --file /tmp/liferay-aws-bootstrap-${CURRENT_VERSION}.tar.gz \ | |
| --gzip \ | |
| --verbose \ | |
| cloud/scripts/setup_aws.sh \ | |
| cloud/scripts/versions_aws.tfvars \ | |
| cloud/terraform/aws/eks/* \ | |
| cloud/terraform/aws/gitops/platform/* \ | |
| cloud/terraform/aws/gitops/resources/* \ | |
| cloud/terraform/aws/grafana/* | |
| gcloud storage cp \ | |
| /tmp/liferay-aws-bootstrap-${CURRENT_VERSION}.tar.gz \ | |
| ${GCS_PATH} | |
| publish-liferay-gcp-bootstrap: | |
| if: ${{github.repository == 'liferay/liferay-portal'}} | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Authenticate to Google Cloud | |
| uses: google-github-actions/auth@v2 | |
| with: | |
| service_account: ${{secrets.GCP_SA}} | |
| workload_identity_provider: ${{secrets.GCP_WORKLOAD_IDENTITY_PROVIDER}} | |
| - name: Set up Google Cloud CLI | |
| uses: google-github-actions/setup-gcloud@v2 | |
| with: | |
| project_id: ${{secrets.GCP_PROJECT_ID}} | |
| - name: Set up variables | |
| run: | | |
| CURRENT_VERSION="$(jq -r '."liferay-gcp-bootstrap"' ./cloud/scripts/versions.json)" | |
| echo "CURRENT_VERSION=${CURRENT_VERSION}" >> ${GITHUB_ENV} | |
| GCS_PATH="gs://liferay-cloud-native-bootstrap/bootstrap/liferay-gcp-bootstrap/liferay-gcp-bootstrap-${CURRENT_VERSION}.tar.gz" | |
| echo "GCS_PATH=${GCS_PATH}" >> ${GITHUB_ENV} | |
| - id: verify_version | |
| name: Verify version | |
| run: | | |
| if ! gsutil --quiet stat ${GCS_PATH} | |
| then | |
| echo "Verified version ${CURRENT_VERSION}." | |
| echo "CURRENT_VERSION=${CURRENT_VERSION}" >> ${GITHUB_ENV} | |
| echo "should_publish=true" >> ${GITHUB_OUTPUT} | |
| else | |
| echo "Version ${CURRENT_VERSION} already exists. Skipping publish." | |
| fi | |
| - if: ${{steps.verify_version.outputs.should_publish == 'true'}} | |
| name: Package and push GCP bootstrap scripts | |
| run: | | |
| tar \ | |
| --create \ | |
| --file /tmp/liferay-gcp-bootstrap-${CURRENT_VERSION}.tar.gz \ | |
| --gzip \ | |
| --verbose \ | |
| cloud/scripts/setup_gcp.sh \ | |
| cloud/scripts/versions_gcp.tfvars \ | |
| cloud/terraform/gcp/gitops/platform/* \ | |
| cloud/terraform/gcp/gitops/resources/* \ | |
| cloud/terraform/gcp/gke/* | |
| gcloud storage cp \ | |
| /tmp/liferay-gcp-bootstrap-${CURRENT_VERSION}.tar.gz \ | |
| ${GCS_PATH} | |
| on: | |
| push: | |
| branches: | |
| - master | |
| paths: | |
| - .github/workflows/ci-publish-cloud-scripts.yaml | |
| - cloud/scripts/versions.json | |
| permissions: | |
| id-token: write |