-
Notifications
You must be signed in to change notification settings - Fork 1
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
37be145
commit 738a84c
Showing
1 changed file
with
23 additions
and
5 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 |
---|---|---|
|
@@ -6,16 +6,34 @@ on: | |
description: The name of the new project to create. | ||
required: true | ||
type: string | ||
templateRepo: | ||
description: The template repository to clone from. | ||
templateRepoOrg: | ||
description: The organization of the template repository to clone from. | ||
required: true | ||
type: string | ||
default: noahburrell0/project-template | ||
default: noahburrell0 | ||
templateRepoName: | ||
description: The name of the template repository to clone from. | ||
required: true | ||
type: string | ||
default: project-template | ||
jobs: | ||
clone-template-repo: | ||
runs-on: ubuntu-latest | ||
env: | ||
GH_TOKEN: ${{ secrets.GH_TOKEN }} | ||
steps: | ||
- run: gh repo create argocd-project-${{ inputs.projectName }} --template ${{ inputs.templateRepo }} --clone --public | ||
- run: ls -al | ||
- name: Create repo from template | ||
run: gh repo create argocd-project-${{ inputs.projectName }} --template ${{ inputs.templateRepoOrg }}/${{ inputs.templateRepoName }} --clone --public | ||
- name: Find/replace project name | ||
run: | | ||
sed -i "s/REPLACE_ME_NAME/guestbook-${{ inputs.projectName }}/g" argocd-project-${{ inputs.projectName }}/apps/guestbook.yaml | ||
sed -i "s/REPLACE_ME_PROJECT/${{ inputs.projectName }}/g" argocd-project-${{ inputs.projectName }}/apps/guestbook.yaml | ||
sed -i "s/REPLACE_ME_REPO/https://github.com/${{ inputs.templateRepoOrg }}/argocd-project-${{ inputs.projectName }}.git/g" argocd-project-${{ inputs.projectName }}/apps/guestbook.yaml | ||
- name: Setup git and push changes | ||
run: | | ||
cd argocd-project-${{ inputs.projectName }} | ||
/usr/bin/git config --global url."https://${GH_TOKEN}:[email protected]/".insteadOf "https://github.com/" | ||
/usr/bin/git config --global user.name "Akuity Bot" | ||
/usr/bin/git config --global user.email "[email protected]" | ||
/usr/bin/git commit -m "Update project name" | ||
/usr/bin/git push -u origin main |