-
Notifications
You must be signed in to change notification settings - Fork 1
63 lines (55 loc) · 1.97 KB
/
deploy.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
name: Deploy
on:
push:
branches:
- develop
jobs:
build:
runs-on: ubuntu-latest
container: pandoc/latex
steps:
- uses: actions/checkout@v2
- name: Install mustache (to update the date)
run: |
apk add ruby
gem install mustache
- name: Run build script
run: |
echo "🔧 Running build script..."
sh -x ./build.sh
- name: Debug: Check available directories after build
run: |
echo "🔍 Checking directories after build..."
ls -al
echo "🔍 Checking possible build output folders..."
ls -al output || echo "⚠️ output directory not found!"
ls -al dist || echo "⚠️ dist directory not found!"
ls -al build || echo "⚠️ build directory not found!"
- name: Detect correct build folder
id: detect-folder
run: |
if [ -d "output" ]; then
echo "BUILD_DIR=output" >> $GITHUB_ENV
elif [ -d "dist" ]; then
echo "BUILD_DIR=dist" >> $GITHUB_ENV
elif [ -d "build" ]; then
echo "BUILD_DIR=build" >> $GITHUB_ENV
else
echo "🚨 ERROR: No known build directory (output, dist, build) found!"
exit 1
fi
echo "✅ Build directory detected: $BUILD_DIR"
- name: Pushes to another repository
id: push_directory
uses: cpina/github-action-push-to-another-repository@main
env:
API_TOKEN_GITHUB: ${{ secrets.AUTO_ACTIONS }}
with:
source-directory: ${{ env.BUILD_DIR }}
destination-github-username: yelynnn
destination-repository-name: JMarketYard
user-email: ${{ secrets.EMAIL }}
commit-message: ${{ github.event.commits[0].message }}
target-branch: develop
- name: Test get variable exported by push-to-another-repository
run: echo "DESTINATION_CLONED_DIRECTORY = $DESTINATION_CLONED_DIRECTORY"