PromucFlow_constructor/.github/workflows/cleanup-dp.yml
Arpit Mohan 2650ea161d
ci: Updating actions/checkout to v4 and defaulting to fetch-depth 1 instead of 0 (#29281)
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

- **Chores**
- Updated GitHub Actions workflows to use `actions/checkout@v4` for
improved performance and reliability.
- Removed `fetch-depth` parameter to simplify checkout steps across
various workflows.
  - Standardized quote usage for consistency in workflow files.

- **Documentation**
- Adjusted formatting and descriptions in workflow files for better
clarity and readability.

- **Refactor**
- Aligned multiple workflow files to follow a consistent structure and
naming convention.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->

fetch-depth 0 causes the Github workflow to checkout the entire Git
history. This is not required. We only need to check out the head of the
commit. By default, actions/checkout has fetch-depth=1, hence removing
it from the workflow completely for simplicity.
2023-12-05 13:44:43 +05:30

47 lines
1.7 KiB
YAML

name: Cleanup Deploy Previews
on:
workflow_dispatch:
schedule:
- cron: 0 0 * * *
jobs:
execute:
runs-on: ubuntu-latest
steps:
# Checkout the code
- uses: actions/checkout@v2
- name: Install mongosh
run: |
sudo apt-get update
sudo apt-get install -y wget gnupg
wget -qO - https://www.mongodb.org/static/pgp/server-5.0.asc | sudo apt-key add -
echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu jammy/mongodb-org/5.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-6.0.list
sudo apt-get update
sudo apt-get install -y mongodb-mongosh
- name: Install relevant packages
run: |
which aws
sudo apt update -q
sudo apt install -y curl unzip less jq
curl -LO https://storage.googleapis.com/kubernetes-release/release/v1.23.6/bin/linux/amd64/kubectl
sudo install -o root -g root -m 0755 kubectl /usr/local/bin/kubectl
curl -fsSL -o get_helm.sh https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3
chmod 700 get_helm.sh
./get_helm.sh
- name: Delete Helm chart
env:
AWS_ROLE_ARN: ${{ secrets.APPSMITH_EKS_AWS_ROLE_ARN }}
AWS_ACCESS_KEY_ID: ${{ secrets.APPSMITH_CI_AWS_SECRET_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.APPSMITH_CI_AWS_SECRET_ACCESS_KEY }}
DB_USERNAME: ${{ secrets.DB_USERNAME }}
DB_PASSWORD: ${{ secrets.DB_PASSWORD }}
DB_URL: ${{ secrets.DB_URL }}
GH_TOKEN: ${{ secrets.APPSMITH_DEPLOY_PREVIEW_PAT }}
DP_EFS_ID: ${{ secrets.APPSMITH_DP_EFS_ID }}
run: /bin/bash ./scripts/cleanup_dp.sh