-
Notifications
You must be signed in to change notification settings - Fork 0
70 lines (66 loc) ยท 2.34 KB
/
deploy-integration.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
name: Deploy
on:
workflow_call:
inputs:
user_name:
description: ๋ฐฐํฌํ ์ฌ์ฉ์
required: true
type: string
stage:
description: ๋ฐฐํฌ ์ ํ(production,develop)
required: true
type: string
secrets:
ACCESS_TOKEN:
required: true
env:
DEVELOP_REPOSITORY: deploy-sambad-develop
PRODUCTION_REPOSITORY: deploy-sambad
jobs:
variable:
name: set the target STAGE
runs-on: ubuntu-latest
outputs:
DESTINATION_REPOSITORY: ${{inputs.stage == 'production' && env.PRODUCTION_REPOSITORY || env.DEVELOP_REPOSITORY}}
steps:
- name: get variables
run: echo "$DESTINATION_REPOSITORY" |
echo "${{inputs.STAGE}}"
build:
needs: variable
runs-on: ubuntu-latest
container: pandoc/latex
outputs:
DESTINATION_REPOSITORY: ${{needs.variable.outputs.DESTINATION_REPOSITORY}}
target-branch: ${{steps.deploy-information.outputs.target-branch}}
steps:
- uses: actions/checkout@v4
- name: Install mustache (to update the date)
run: apk add ruby && gem install mustache
- name: creates ouput
run: sh ./tools/build.sh
- name: Pushes to another repository
uses: cpina/github-action-push-to-another-repository@main
env:
API_TOKEN_GITHUB: ${{ secrets.ACCESS_TOKEN }}
with:
source-directory: 'output'
destination-github-username: 'sambad-adventure'
destination-repository-name: ${{needs.variable.outputs.DESTINATION_REPOSITORY}}
user-email: ${{secrets.EMAIL}}
commit-message: 'chore: ${{inputs.user_name}} deploy ${{inputs.stage}}'
target-branch: ${{inputs.stage == 'production' && 'main' || 'main' }}
- name: get deploy information
id: deploy-information
run: echo "target-repository=${{needs.variable.outputs.DESTINATION_REPOSITORY}}" >> "$GITHUB_OUTPUT" |
echo "target-branch=${{inputs.stage == 'production' && 'main' || 'main' }}" >> "$GITHUB_OUTPUT"
info:
name: get deploy information
runs-on: ubuntu-latest
needs: build
steps:
- run: echo "$DESTINATION_REPOSITORY" |
echo "$target-branch"
env:
destination-repository: ${{needs.build.outputs.DESTINATION_REPOSITORY}}
target-branch: ${{needs.build.outputs.target-branch}}