-
Notifications
You must be signed in to change notification settings - Fork 0
111 lines (99 loc) · 3.4 KB
/
release-docs.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
99
100
101
102
103
104
105
106
107
108
109
110
111
name: release-docs
on:
# for testing
workflow_dispatch:
# for production
release:
types: [created]
env:
DEBUG_FLAG: ${{ true }}
# DEBUG_FLAG: ${{ false }}
RELEASE_PLATFORM_DIR: "release"
RELEASE_RUNNER_OUTPUT_DIR: "release/tmp"
RELEASE_OUTPUT_NAME: "platform-api-release"
jobs:
release_docs:
runs-on: ubuntu-22.04
steps:
- name: Check Auth
if: github.event_name == 'workflow_dispatch' && github.actor != 'ricardojosegomezulmke' && github.actor != '195858'
run: |
echo "not authorized"
echo '::set-output name=IS_AUTHORIZED::false'
id: auth
- name: Cancel Workflow
if: ${{ always() && steps.auth.outputs.IS_AUTHORIZED == 'false' }}
uses: andymckay/[email protected]
- name: Checkout Current Branch
uses: actions/checkout@v2
with:
ref: ${{ github.ref }}
- name: env before install
if: env.DEBUG_FLAG == 'true'
run: |
echo "bash --version: "; bash --version
echo "node --version: "; node --version
echo "npm --version: "; npm --version
echo ">>> environment: RELEASE_* "
env | grep RELEASE
# - uses: actions/setup-node@v2
# with:
# node-version: '12.x'
# registry-url: 'https://registry.npmjs.org'
#
# - name: env after install
# if: env.DEBUG_FLAG == 'true'
# run: |
# echo "bash --version: "; bash --version
# echo "node --version: "; node --version
# echo "npm --version: "; npm --version
# echo "docker --version"; docker --version
# echo "docker-compose --version"; docker-compose --version
#
# - uses: docker/login-action@v1
# with:
# username: ${{ secrets.DOCKERHUB_USERNAME }}
# password: ${{ secrets.DOCKERHUB_TOKEN }}
# - name: Release
# run: |
# export NODE_AUTH_TOKEN=${{ secrets.NPM_TOKEN }}
# export APIM_SOLACE_PLATFORM_API_PROJECT_HOME="$GITHUB_WORKSPACE"
# cd "$APIM_SOLACE_PLATFORM_API_PROJECT_HOME/${RELEASE_PLATFORM_DIR}"
# ./release.sh
#
# - name: Archive logs
# if: ${{ (failure() && !cancelled()) || (always() && (github.event_name=='workflow_dispatch' || env.DEBUG_FLAG=='true') ) }}
# uses: actions/upload-artifact@v2
# with:
# name: ${{ env.RELEASE_OUTPUT_NAME }}
# path: ${{ github.workspace }}/${{ env.RELEASE_RUNNER_OUTPUT_DIR }}
# if-no-files-found: error
#
# # Release docs
- name: "docs:setup python"
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: "docs:install dependencies"
run: |
python -m pip install --upgrade pip
pip install -r docs/devel/docs.requirements.txt
- name: "docs:make"
run: |
cd docs
./make.sh
- name: "docs: publish to gh-pages"
run: |
git fetch origin gh-pages
git worktree add gh-pages gh-pages
date > generated.txt
git config user.name github-actions
git config user.email [email protected]
rsync -av ./docs/build/html/ gh-pages/
cd gh-pages
git add -A
git commit --allow-empty -F ../generated.txt
# git push -f -u origin gh-pages
git push -u origin gh-pages
###
# The End.