-
Notifications
You must be signed in to change notification settings - Fork 0
62 lines (57 loc) · 1.79 KB
/
deploy_gh_actions.yml
File metadata and controls
62 lines (57 loc) · 1.79 KB
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
name: Deploy GitHub Actions
on:
push:
branches:
- main
env:
gh_actions_git_path: './gh-actions/'
main_git_path: './main/'
jobs:
deploy-typescript:
runs-on: ubuntu-latest
steps:
- name: Checkout main
uses: actions/checkout@v3
with:
path: ${{ env.main_git_path }}
- name: Checkout gh-actions
uses: actions/checkout@v3
with:
ref: 'gh-actions'
path: ${{ env.gh_actions_git_path }}
- name: npm install
working-directory: ${{ env.main_git_path }}/typescript
run: |
npm install
- name: Build gitcc
working-directory: ${{ env.main_git_path }}/typescript
run: |
npm run build
npm run package
- name: Remove old files
working-directory: ${{ env.gh_actions_git_path }}
run: |
rm -rf ./*
- name: Copy new files
run: |
mkdir -p ${{ env.gh_actions_git_path }}/typescript/dist/
cp -f ${{ env.main_git_path }}/typescript/README.rst ${{ env.gh_actions_git_path }}
cp -rf ${{ env.main_git_path }}/typescript/dist* ${{ env.gh_actions_git_path }}/typescript/
cp -f ${{ env.main_git_path }}/action.yml ${{ env.gh_actions_git_path }}
- name: Push new files
working-directory: ${{ env.gh_actions_git_path }}
run: |
git config user.name github-actions
git config user.email github-actions@github.com
git add .
git diff-index --quiet HEAD || git commit -am "[actions] Build of ${{ github.sha }}"
git push
commit-check:
name: Commit Check
runs-on: ubuntu-latest
needs: deploy-typescript
steps:
- name: Commit Check
uses: IceflowRE/gitcc@gh-actions
with:
validator: "SimpleTag"