Skip to content

Commit a71be47

Browse files
gustavocidornelaswhoseoyster
authored andcommitted
Completes UNB-2296 - GitHub action to auto-commit examples changes to examples-gallery repo
1 parent 3573ca7 commit a71be47

File tree

1 file changed

+42
-0
lines changed

1 file changed

+42
-0
lines changed
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: publish-to-examples-gallery
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
changed_files:
10+
runs-on: ubuntu-latest
11+
outputs:
12+
run_validations: ${{ steps.changes.outputs.run_validations }}
13+
steps:
14+
- uses: actions/checkout@v2
15+
with:
16+
fetch-depth: 0
17+
- name: Get changed files
18+
id: changes
19+
run: |
20+
echo "::set-output name=run_validations::$(git diff --name-only --diff-filter=ACMRT ${{ github.event.before }} ${{ github.sha }} examples/ | xargs)"
21+
build:
22+
runs-on: ubuntu-latest
23+
needs: changed_files
24+
if: ${{needs.changed_files.outputs.run_validations}}
25+
env:
26+
USER_EMAIL: Hello
27+
steps:
28+
- uses: actions/checkout@v2
29+
- name: Pushes to another repository
30+
id: push_directory
31+
uses: cpina/github-action-push-to-another-repository@ssh-deploy-key
32+
env:
33+
SSH_DEPLOY_KEY: ${{ secrets.SSH_DEPLOY_KEY }}
34+
with:
35+
source-directory: examples
36+
destination-github-username: "unboxai"
37+
destination-repository-name: "examples-gallery"
38+
user-email: $GITHUB_ACTOR
39+
commit-message: ${{ github.event.head_commit.message }}
40+
target-branch: main
41+
- name: Test get variable exported by push-to-another-repository
42+
run: echo $DESTINATION_CLONED_DIRECTORY

0 commit comments

Comments
 (0)