-
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
0 parents
commit 6b5f73d
Showing
2 changed files
with
44 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,3 @@ | ||
# gapush-to-deploy | ||
|
||
GitHub Action to deploy main branch to production a la Heroku. |
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,41 @@ | ||
name: "GitHub Action Push-to-deploy" | ||
description: "GitHub Action to deploy main branch to production a la Heroku." | ||
inputs: | ||
git-directory: | ||
description: "Your git bare repo directory." | ||
required: true | ||
git-user: | ||
description: "Git user. Usually deploy." | ||
required: true | ||
git-host: | ||
description: "Git host." | ||
required: true | ||
ssh-private-key: | ||
description: "SSH private key." | ||
required: true | ||
ssh-known-hosts: | ||
description: "SSH known hosts." | ||
required: true | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
depth: 0 | ||
- name: Setup remote git | ||
run: | | ||
git config --global user.email "${{ inputs.git-user }}@${{ inputs.git-host }}" | ||
git config --global user.name "${{ inputs.git-user }}" | ||
git remote add prod ${{ inputs.git-user }}@${{ inputs.git-host }}:${{ inputs.git-directory }} | ||
shell: bash | ||
- name: Install SSH key | ||
uses: shimataro/ssh-key-action@v2 | ||
with: | ||
key: ${{ inputs.ssh-private-key }} | ||
known_hosts: ${{ inputs.ssh-known-hosts }} | ||
- name: Push-to-deploy | ||
run: | | ||
git push prod HEAD:main | ||
shell: bash |