generated from cms/tibi-docs
This commit is contained in:
parent
c9135d03cf
commit
44f7934217
@ -1,10 +1,6 @@
|
|||||||
name: deploy to production
|
name: deploy to production
|
||||||
|
|
||||||
on: "push"
|
on: "push"
|
||||||
# push:
|
|
||||||
# branches:
|
|
||||||
# - master
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
deploy:
|
deploy:
|
||||||
name: deploy
|
name: deploy
|
||||||
@ -17,40 +13,81 @@ jobs:
|
|||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
lfs: true
|
|
||||||
submodules: true
|
|
||||||
- run: |
|
|
||||||
git fetch --force --tags
|
|
||||||
|
|
||||||
# setup node 18
|
|
||||||
- name: setup node 18
|
- name: setup node 18
|
||||||
uses: actions/setup-node@v3
|
uses: actions/setup-node@v3
|
||||||
with:
|
# with:
|
||||||
node-version: 18
|
# node-version: 18
|
||||||
|
# cache: yarn
|
||||||
|
|
||||||
- name: build docs
|
- name: install dependencies
|
||||||
env:
|
env:
|
||||||
FORCE_COLOR: "true"
|
FORCE_COLOR: "true"
|
||||||
run: |
|
run: |
|
||||||
node --version
|
npm install -g yarn
|
||||||
cd docs
|
|
||||||
yarn install
|
yarn install
|
||||||
yarn docpress:build
|
|
||||||
|
|
||||||
- name: deploy docs
|
- name: modify config
|
||||||
# only if branch is master
|
run: |
|
||||||
|
sed -i 's#\(sentryEnvironment.*\)".*"#\1"${GITHUB_REF_NAME}"#g' frontend/src/config.ts
|
||||||
|
sed -i 's#//\( sentry\\.init.*\)#\1#g' frontend/src/config.ts
|
||||||
|
export $(cat .env | xargs)
|
||||||
|
echo "PROJECT_RELEASE=${RELEASE_PROJECT_SLUG}.r`git rev-list HEAD --count`-`git describe --all --long | sed 's+/+-+'`" >> .env
|
||||||
|
export $(cat .env | xargs)
|
||||||
|
echo ______ .env ______
|
||||||
|
cat .env
|
||||||
|
echo
|
||||||
|
sed -i 's#\(const release = \).*#\1"'${PROJECT_RELEASE}'"#g' api/hooks/config-client.js
|
||||||
|
|
||||||
|
# bash scripts/preload-meta.sh frontend/spa.html
|
||||||
|
# bash scripts/preload-meta.sh frontend/spa.html > frontend/_spa.html
|
||||||
|
# cp frontend/_spa.html frontend/spa.html
|
||||||
|
|
||||||
|
export stamp=`date +%s`
|
||||||
|
sed -i s/__TIMESTAMP__/$stamp/g frontend/spa.html
|
||||||
|
# sed -i s/__TIMESTAMP__/$stamp/g frontend/serviceworker.js
|
||||||
|
# cat frontend/serviceworker.js
|
||||||
|
# rm api/templates/spa.html
|
||||||
|
# cp frontend/spa.html api/templates/spa.html
|
||||||
|
echo ______ frontend/spa.html ______
|
||||||
|
cat frontend/spa.html
|
||||||
|
|
||||||
|
- name: build
|
||||||
|
env:
|
||||||
|
FORCE_COLOR: "true"
|
||||||
|
run: |
|
||||||
|
yarn build
|
||||||
|
|
||||||
|
#- name: build ssr
|
||||||
|
# env:
|
||||||
|
# FORCE_COLOR: "true"
|
||||||
|
# run: |
|
||||||
|
# yarn build:server
|
||||||
|
|
||||||
|
- name: build legacy
|
||||||
|
env:
|
||||||
|
FORCE_COLOR: "true"
|
||||||
|
run: |
|
||||||
|
yarn build:legacy
|
||||||
|
|
||||||
|
#- name: staging api test
|
||||||
|
# if: github.ref == 'refs/heads/dev'
|
||||||
|
# run: |
|
||||||
|
# targetDir=/data/${GITHUB_REPOSITORY}/${GITHUB_REF_NAME}
|
||||||
|
# mkdir -p targetDir
|
||||||
|
# rsync -av api $targetDir/
|
||||||
|
# mkdir -p $targetDir/frontend/dist
|
||||||
|
# rsync -av frontend/dist/ $targetDir/frontend/dist/
|
||||||
|
|
||||||
|
#- name: staging frontend
|
||||||
|
# if: github.ref == 'refs/heads/dev'
|
||||||
|
# run: |
|
||||||
|
# docker compose -p ${GITHUB_REF_NAME}-${GITHUB_REPOSITORY_NAME}-${GITHUB_REPOSITORY_OWNER} up -d --build --remove-orphans
|
||||||
|
|
||||||
|
- name: deploy
|
||||||
if: github.ref == 'refs/heads/master'
|
if: github.ref == 'refs/heads/master'
|
||||||
env:
|
env:
|
||||||
RSYNC_HOST: ftp1.webmakers.de
|
RSYNC_USER: "gruenwerker_rsync_master"
|
||||||
RSYNC_PORT: 22222
|
|
||||||
RSYNC_USER: webmakers_tibi_docs_rsync_master
|
|
||||||
RSYNC_PASS: ${{ secrets.rsync_master }}
|
RSYNC_PASS: ${{ secrets.rsync_master }}
|
||||||
run: |
|
run: |
|
||||||
cd docs
|
scripts/deploy.sh ftp1.webmakers.de $RSYNC_USER $RSYNC_PASS
|
||||||
ls -la
|
|
||||||
|
|
||||||
rsync -rlcgD --perms -i -u -v --stats --progress \
|
|
||||||
--delete \
|
|
||||||
-e "sshpass -p ${RSYNC_PASS} ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p ${RSYNC_PORT}" \
|
|
||||||
_docpress/ \
|
|
||||||
${RSYNC_USER}@${RSYNC_HOST}:./ \
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
AddType application/javascript .mjs
|
AddType application/javascript .mjs
|
||||||
|
|
||||||
#DirectoryIndex index.html spa.html
|
#DirectoryIndex index.html spa.html
|
||||||
DirectoryIndex noindex
|
DirectoryIndex spa.html
|
||||||
|
|
||||||
<ifModule mod_rewrite.c>
|
<ifModule mod_rewrite.c>
|
||||||
RewriteEngine On
|
RewriteEngine On
|
||||||
@ -11,6 +11,6 @@ DirectoryIndex noindex
|
|||||||
|
|
||||||
RewriteCond %{REQUEST_FILENAME} !-f
|
RewriteCond %{REQUEST_FILENAME} !-f
|
||||||
RewriteCond %{REQUEST_FILENAME} !-d
|
RewriteCond %{REQUEST_FILENAME} !-d
|
||||||
#RewriteRule ^/?(.*)$ http://tibi-server:8080/api/v1/_/demo/ssr?token=owshwerNwoa&url=/$1 [P,QSA,L]
|
|
||||||
RewriteRule (.*) /spa.html [QSA,L]
|
RewriteRule (.*) /spa.html [QSA,L]
|
||||||
</ifModule>
|
</ifModule>
|
||||||
|
Loading…
Reference in New Issue
Block a user