-
Notifications
You must be signed in to change notification settings - Fork 0
66 lines (63 loc) ยท 2.26 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
name: Push branch & deploy On remote repository only for Vercel
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}}
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: ${{github.event.commits[0].message}}
target-branch: ${{inputs.stage == 'prodction' && '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 == 'prodction' && 'main' || 'main' }}" >> "$GITHUB_OUTPUT"
info:
name: get deploy information
runs-on: ubuntu-latest
needs: build
steps:
- env:
destination-repository: ${{needs.build.outputs.destination-repository}}
target-branch: ${{needs.build.outputs.target-branch}}
run: |
echo "$destination-repository" |
echo "$target-branch"