-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a350b83
commit 76d4087
Showing
1 changed file
with
51 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
name: "Code Deployment on Acquia Env" | ||
on: | ||
push: | ||
branches: [ code-deployment ] | ||
jobs: | ||
acquia_code_deployment: | ||
#if: ${{ github.ref == 'refs/heads/develop' && github.event_name == 'push' }} | ||
name: "Code Deployment on Acquia Environment" | ||
env: | ||
GIT_AUTHOR_NAME: "Vishal Khode" | ||
GIT_COMMITTER_NAME: "Vishal Khode" | ||
GIT_COMMITTER_EMAIL: "[email protected]" | ||
GIT_AUTHOR_EMAIL: "[email protected]" | ||
runs-on: ubuntu-latest | ||
environment: acquia_code_deployment | ||
concurrency: production | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- name: Configure SSH keys | ||
run: | | ||
mkdir -p ~/.ssh | ||
echo "${ACQUIA_CLOUD_SSH_PRIVATE_KEY}" > ~/.ssh/id_rsa | ||
chmod 600 ~/.ssh/id_rsa | ||
eval `ssh-agent -s` | ||
ssh-add ~/.ssh/id_rsa | ||
ssh-keyscan -H "orionacmsdev.ssh.prod.acquia-sites.com" >> ~/.ssh/known_hosts | ||
# Loop through each line in the environment variable. | ||
echo "${ACQUIA_CLOUD_KNOWN_HOSTS}" | while IFS= read -r KNOWN_HOST; do | ||
if [[ -n "${KNOWN_HOST}" ]]; then | ||
CLEANED_HOST=$(echo "${KNOWN_HOST}" | tr -d '\r' | xargs -n1) | ||
ssh-keyscan -v -H "${CLEANED_HOST}" >> ~/.ssh/known_hosts 2>/dev/null || { | ||
echo "Warning: Unable to scan host ${CLEANED_HOST}. Skipping." | ||
} | ||
fi | ||
done | ||
shell: bash | ||
env: | ||
ACQUIA_CLOUD_SSH_PRIVATE_KEY: ${{ secrets.ACQUIA_CLOUD_SSH_PRIVATE_KEY }} | ||
ACQUIA_CLOUD_KNOWN_HOSTS: ${{ vars.ACQUIA_CLOUD_KNOWN_HOSTS }} | ||
- name: Setup Acquia Cloud CLI | ||
run: | | ||
curl -OL https://github.com/acquia/cli/releases/latest/download/acli.phar | ||
chmod +x acli.phar | ||
mv acli.phar /usr/local/bin/acli | ||
acli --version | ||
#acli auth:login --key="${ACQUIA_API_KEY}" --secret="${ACQUIA_API_SECRET}" | ||