forked from mixcore/mix.core
-
Notifications
You must be signed in to change notification settings - Fork 0
41 lines (31 loc) · 1.29 KB
/
mix.spa.portal-dispatch.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
name: CI
on: [repository_dispatch]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Run a one-line script
run: echo Hello, world!
- name: Run a multi-line script
run: |
echo Add other actions to build,
echo test, and deploy your project.
- name: Commit to repository
env:
GITHUB_TOKEN: ${{ secrets.github_token }}
COMMIT_MSG: |
[CI/CD] Commit latest code from mix.spa.portal
skip-checks: true
run: |
# Hard-code user configuration
git config --global user.email "i.love.to.smile.around@gmail.com"
git config --global user.name "smilefounder"
git clone https://github.com/mixcore/mix.spa.portal.git ${HOME}/work/${GITHUB_REPOSITORY}/mix.spa.portal/
git checkout develop
cp -a ${HOME}/work/${GITHUB_REPOSITORY}/mix.spa.portal/dist/. ${GITHUB_WORKSPACE}/src/
# Update origin with token
git remote set-url origin https://x-access-token:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git
git add .
# Only commit and push if we have changes
git diff --quiet && git diff --staged --quiet || (git commit -m "${COMMIT_MSG}"; git push origin develop)