FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
docs/.github/workflows/deploy.yml at master · CommandAPI/docs · GitHub
Uh oh!
There was an error while loading.
Please reload this page
.
CommandAPI
/
docs
Public
Notifications
You must be signed in to change notification settings
Fork
4
Star
0
Code
Issues
2
Pull requests
2
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
docs
/
.github
/
workflows
/
deploy.yml
Copy path
View runs
More file actions
More file actions
Latest commit
History
History
History
60 lines (46 loc) · 1.76 KB
Breadcrumbs
docs
/
.github
/
workflows
/
deploy.yml
Copy path
File metadata and controls
60 lines (46 loc) · 1.76 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
name
:
Deploy
on
:
workflow_run
:
workflows
:
[ Build ]
types
:
[ completed ]
push
:
branches
:
-
'
build/**
'
jobs
:
Deploy
:
runs-on
:
ubuntu-latest
if
:
${{ github.event.workflow_run.conclusion == 'success' }}
steps
:
-
name
:
Checkout
uses
:
actions/checkout@v2
-
name
:
Merge Build Branches
run
:
|
CNAME='docs.commandapi.dev'
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
TARGET_BRANCH="deploy"
BASE_BRANCH="origin/build/master"
ORIGIN_URL=$(git remote get-url origin)
SUFFIX=".git"
TARGET_URL=${ORIGIN_URL%$SUFFIX}
git fetch origin
git checkout -b ${TARGET_BRANCH} ${BASE_BRANCH}
BRANCHES=$(git branch -r | grep 'origin/build/ver/')
for BRANCH in $BRANCHES; do
BRANCH_NAME=$(echo $BRANCH | sed 's|origin/||')
LOCAL_DIR=$(echo $BRANCH_NAME | sed 's|build/ver/||')
TARGET_ZIP="${TARGET_URL}/archive/refs/heads/${BRANCH_NAME}.zip"
echo "Branch: ${BRANCH_NAME}"
echo "URL: ${TARGET_ZIP}"
echo "Local: ${LOCAL_DIR}"
mkdir -p ${LOCAL_DIR}
wget --max-redirect=10 -O ${LOCAL_DIR}/dist.zip ${TARGET_ZIP}
TEMP_DIR=$(mktemp -d)
unzip ${LOCAL_DIR}/dist.zip -d ${TEMP_DIR}
mv ${TEMP_DIR}/*/* ${LOCAL_DIR}
rm ${LOCAL_DIR}/dist.zip
done
echo ${CNAME} > CNAME
git add .
git commit -m "GitHub Actions Auto Deploy"
git push -f origin "${TARGET_BRANCH}"
Back
|
FazBrowse Home
|
New Git URL