-
Notifications
You must be signed in to change notification settings - Fork 0
/
action.yml
46 lines (46 loc) · 1.45 KB
/
action.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
name: "Publish To Github"
description: "Push/Update Branch from a directory. Built for compilaiton to creating actions, publishing Github Pages"
inputs:
repo_name:
description: "Repository name with owner. For example, cedric05/dothttp"
required: true
default: ${{ github.repository }}
branch:
description: The branch to push
required: true
directory:
description: "Directory to push"
required: true
commit_message:
description: "commit message"
required: true
default: "publish directory to branch"
committer_email:
description: "commiter email id"
default: "[email protected]"
required: true
committer_username:
description: "commiter email id"
default: "[email protected]"
required: true
runs:
using: "composite"
steps:
- name: Checkout
uses: rodrigorodriguescosta/checkout@main
with:
repository: ${{ inputs.repo_name }}
path: /tmp/${{ inputs.repo_name }}
ref: ${{ inputs.branch }}
- run: |
cd /tmp/${{ inputs.repo_name }}
rm -rf *
cp -r ${{ inputs.directory }}/* /tmp/${{ inputs.repo_name }}
git config --global user.name "${{ inputs.committer_username }}"
git config --global user.email "${{ inputs.committer_email }}"
git add -A
git commit -m "${{ inputs.commit_message }}"
git push origin ${{ inputs.branch }}
cd ..
rm -rf /tmp/${{ inputs.repo_name }}
shell: bash