forked from codeigniter4/CodeIgniter4
-
Notifications
You must be signed in to change notification settings - Fork 0
98 lines (85 loc) · 2.9 KB
/
deploy-framework.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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
# When a new Release is created, deploy relevant
# files to each of the generated repos.
name: Deploy Framework
on:
release:
types: [published]
jobs:
framework:
name: Deploy to framework
if: github.repository == 'codeigniter4/CodeIgniter4'
runs-on: ubuntu-latest
steps:
- name: Identify
run: |
git config --global user.email "[email protected]"
git config --global user.name "${GITHUB_ACTOR}"
- name: Checkout source
uses: actions/checkout@v3
with:
path: source
- name: Checkout target
uses: actions/checkout@v3
with:
repository: codeigniter4/framework
token: ${{ secrets.ACCESS_TOKEN }}
path: framework
- name: Chmod
run: chmod +x ./source/.github/scripts/deploy-framework
- name: Deploy
run: ./source/.github/scripts/deploy-framework ${GITHUB_WORKSPACE}/source ${GITHUB_WORKSPACE}/framework ${GITHUB_REF##*/}
- name: Release
uses: actions/github-script@v6
with:
github-token: ${{secrets.ACCESS_TOKEN}}
script: |
const release = await github.rest.repos.getLatestRelease({
owner: context.repo.owner,
repo: context.repo.repo
})
github.rest.repos.createRelease({
owner: context.repo.owner,
repo: 'framework',
tag_name: release.data.tag_name,
name: release.data.name,
body: release.data.body
})
appstarter:
name: Deploy to appstarter
if: github.repository == 'codeigniter4/CodeIgniter4'
runs-on: ubuntu-latest
steps:
- name: Identify
run: |
git config --global user.email "[email protected]"
git config --global user.name "${GITHUB_ACTOR}"
- name: Checkout source
uses: actions/checkout@v3
with:
path: source
- name: Checkout target
uses: actions/checkout@v3
with:
repository: codeigniter4/appstarter
token: ${{ secrets.ACCESS_TOKEN }}
path: appstarter
- name: Chmod
run: chmod +x ./source/.github/scripts/deploy-appstarter
- name: Deploy
run: ./source/.github/scripts/deploy-appstarter ${GITHUB_WORKSPACE}/source ${GITHUB_WORKSPACE}/appstarter ${GITHUB_REF##*/}
- name: Release
uses: actions/github-script@v6
with:
github-token: ${{secrets.ACCESS_TOKEN}}
script: |
const release = await github.rest.repos.getLatestRelease({
owner: context.repo.owner,
repo: context.repo.repo
})
github.rest.repos.createRelease({
owner: context.repo.owner,
repo: 'appstarter',
tag_name: release.data.tag_name,
name: release.data.name,
body: release.data.body
})