Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
setoelkahfi committed May 5, 2024
0 parents commit 6b5f73d
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 0 deletions.
3 changes: 3 additions & 0 deletions README.md
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.
41 changes: 41 additions & 0 deletions action.yml
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

0 comments on commit 6b5f73d

Please sign in to comment.