Remove symlinks to retired privdoc spec (#5)

* Fix workflows with overbrain

Co-authored-by: WWW_cool <WWW_cool@inbox.ru>
This commit is contained in:
Andrew Mayorov 2022-02-03 11:43:07 +03:00 committed by GitHub
parent da5112091b
commit 43db8c9872
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 26 additions and 301 deletions

View File

@ -1,110 +0,0 @@
name: Build
on:
pull_request:
branches: [ v0 ]
jobs:
build:
runs-on: ubuntu-latest
container: node:16
steps:
- name: Checkout branch
uses: actions/checkout@v2
- name: Cache Node Modules and NPM Cache
id: cache
uses: actions/cache@v2
with:
path: |
node_modules
~/.npm
key: ${{ runner.os }}-${{ hashFiles('package-lock.json') }}-node
- name: Install deps
if: steps.cache.outputs.cache-hit != 'true'
run: npm install
- name: Run Tests
run: npm test
- name: Build docsite
run: npm run build
- name: Send Mattermost notification
if: ${{ ! cancelled() }}
run: |
if [ ${{ job.status }} = 'success' ]; then
STATUS=passed
COLOR=#02C100
else
STATUS=failed
COLOR=#E40304
fi
if [ -n "$MATTERMOST_CHANNEL" ]; then
CHANNEL_STR="\"channel\": \"$MATTERMOST_CHANNEL\", "
fi
BRANCH="${{ github.head_ref }}"
REPO="${{ github.repository }}"
RUN_ID="${{ github.run_id }}"
RUN_NUM="${{ github.run_number }}"
AUTHOR_LOGIN="${{ github.event.sender.login }}"
AUTHOR_NAME="$AUTHOR_LOGIN"
AUTHOR_FULL_NAME="$AUTHOR_NAME"
AUTHOR_REAL_NAME="$(curl -H "Accept: application/vnd.github.v3+json" -H "Authorization: token ${{ github.token }}" https://api.github.com/users/$AUTHOR_LOGIN | grep '"name":' | cut -d\" -f4)"
if [ -n "$AUTHOR_REAL_NAME" ]; then
AUTHOR_NAME="$AUTHOR_REAL_NAME"
AUTHOR_FULL_NAME="$AUTHOR_REAL_NAME ($AUTHOR_LOGIN)"
fi
AUTHOR_LINK="${{ github.event.sender.html_url }}"
PR_NUMBER="${{ github.event.pull_request.number }}"
PR_TITLE="${{ github.event.pull_request.title }}"
FALLBACK="Build $RUN_NUM for $REPO by $AUTHOR_NAME has $STATUS on branch $BRANCH"
TEXT="[Build $RUN_NUM](https://github.com/$REPO/actions/runs/$RUN_ID) for [\`$REPO\`](https://github.com/$REPO) by [**$AUTHOR_NAME**]($AUTHOR_LINK) has **$STATUS** on branch [$BRANCH](https://github.com/$REPO/tree/$BRANCH)"
cat <<EOF >mattermost.json
{
$CHANNEL_STR
"username": "GitHub Actions",
"icon_url": "https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png",
"attachments": [
{
"author_name": "$AUTHOR_FULL_NAME",
"author_link": "$AUTHOR_LINK",
"author_icon": "${{ github.event.sender.avatar_url }}",
"title": "$REPO#$PR_NUMBER: $PR_TITLE",
"title_link": "https://github.com/$REPO/pull/$PR_NUMBER",
"fallback": "$FALLBACK",
"text": "$TEXT",
"color": "$COLOR"
}
]
}
EOF
CODE="$(curl \
--include \
--location \
--request POST \
--header 'Content-Type: application/json' \
--silent \
--output curl_error \
--write-out "%{http_code}" \
--data @mattermost.json \
"${MATTERMOST_WEBHOOK_URL:?webhook url must be set}")"
if [ "$CODE" -ge 400 ]; then cat curl_error && exit 1; fi
env:
MATTERMOST_WEBHOOK_URL: ${{ secrets.MATTERMOST_WEBHOOK_URL }}
MATTERMOST_CHANNEL: builds
- name: TEMP Display Mattermost message
if: always()
run: cat mattermost.json

View File

@ -1,28 +0,0 @@
name: gh-pages
on:
push:
branches: [master]
env:
NODEJS_VERSION: '16'
jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: ${{ env.NODEJS_VERSION }}
cache: npm
- run: npm install
- name: Bundle specification
run: npm run build
- name: Publish ReDoc on Github Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./dist
exclude_assets: 'swagger-ui'

View File

@ -1,162 +1,29 @@
name: Release
name: release
on:
push:
branches: [ v0 ]
push:
branches: [v0]
env:
NODEJS_VERSION: '16'
jobs:
release:
runs-on: ubuntu-latest
container: node:16
steps:
- name: Checkout branch
uses: actions/checkout@v2
- name: Cache Node Modules and NPM Cache
id: cache
uses: actions/cache@v2
with:
path: |
node_modules
~/.npm
key: ${{ runner.os }}-${{ hashFiles('package-lock.json') }}-node
- name: Install deps
if: steps.cache.outputs.cache-hit != 'true'
run: npm install
- name: Build docsite
run: npm run build -- ../public
- name: Install rsync (dep for github-pages-deploy-action)
run: |
apt-get update && apt-get install -y rsync
# Necessary for github-pages deploy via ssh-key below
cat <<EOF>> /etc/ssh/ssh_config
Host github.com
User git
ForwardAgent no
StrictHostKeyChecking no
UserKnownHostsFile /dev/null
EOF
- name: Deploy to release branch
uses: JamesIves/github-pages-deploy-action@4.1.4
with:
branch: release/v0
folder: ../public/api
target-folder: api
commit-message: release ${{ github.repository }}@${{ github.sha }} by ${{ github.actor }}
- name: Deploy to Github Pages
uses: JamesIves/github-pages-deploy-action@4.1.4
with:
repository-name: rbkmoney/wallets-api
branch: gh-pages
folder: ../public
target-folder: v0
ssh-key: ${{ secrets.WALLETS_API_DEPLOY_KEY }} # Necessary to push to ANOTHER repo
- name: Send Mattermost notification
if: ${{ ! cancelled() }}
run: |
if [ ${{ job.status }} = 'success' ]; then
STATUS='completed successfully'
COLOR=#02C100
else
STATUS=failed
COLOR=#E40304
fi
if [ -n "$MATTERMOST_CHANNEL" ]; then
CHANNEL_STR="\"channel\": \"$MATTERMOST_CHANNEL\", "
fi
COMMIT="${{ github.sha }}"
COMMIT_MSG="$(cat <<EOF | head -n1
${{ github.event.commits[0]['message'] }}
EOF
)"
REPO="${{ github.repository }}"
RUN_ID="${{ github.run_id }}"
RUN_NUM="${{ github.run_number }}"
AUTHOR_LOGIN="${{ github.event.sender.login }}"
AUTHOR_NAME="$AUTHOR_LOGIN"
AUTHOR_FULL_NAME="$AUTHOR_NAME"
AUTHOR_REAL_NAME="$(curl -H "Accept: application/vnd.github.v3+json" -H "Authorization: token ${{ github.token }}" https://api.github.com/users/$AUTHOR_LOGIN | grep '"name":' | cut -d\" -f4)"
if [ -n "$AUTHOR_REAL_NAME" ]; then
AUTHOR_NAME="$AUTHOR_REAL_NAME"
AUTHOR_FULL_NAME="$AUTHOR_REAL_NAME ($AUTHOR_LOGIN)"
fi
AUTHOR_LINK="${{ github.event.sender.html_url }}"
FALLBACK="Deployment of $REPO@$COMMIT by $AUTHOR_NAME has $STATUS"
TITLE="Deployment of $REPO (Run #$RUN_NUM) has $STATUS"
cat <<EOF >mattermost.json
{
$CHANNEL_STR
"username": "GitHub Actions",
"icon_url": "https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png",
"attachments": [
{
"author_name": "$AUTHOR_FULL_NAME",
"author_link": "$AUTHOR_LINK",
"author_icon": "${{ github.event.sender.avatar_url }}",
"title": "$TITLE",
"title_link": "https://github.com/$REPO/actions/runs/$RUN_ID",
"fallback": "$FALLBACK",
"pretext": "$PRETEXT",
"fields": [
{
"short": true,
"title": "Repo",
"value": "[\`$REPO\`](https://github.com/$REPO)"
},
{
"short": true,
"title": "Commit",
"value": "[$COMMIT](https://github.com/$REPO/commit/$COMMIT)"
},
{
"short": true,
"title": "Status",
"value": "$STATUS"
},
{
"short": true,
"title": "Author",
"value": "$AUTHOR_NAME"
},
{
"short": false,
"title": "Message",
"value": "$COMMIT_MSG"
}
],
"color": "$COLOR"
}
]
}
EOF
CODE="$(curl \
--include \
--location \
--request POST \
--header 'Content-Type: application/json' \
--silent \
--output curl_error \
--write-out "%{http_code}" \
--data @mattermost.json \
"${MATTERMOST_WEBHOOK_URL:?webhook url must be set}")"
if [ "$CODE" -ge 400 ]; then cat curl_error && exit 1; fi
env:
MATTERMOST_WEBHOOK_URL: ${{ secrets.MATTERMOST_WEBHOOK_URL }}
MATTERMOST_CHANNEL: deployments
- name: TEMP Display Mattermost message
if: always()
run: cat mattermost.json
release:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: ${{ env.NODEJS_VERSION }}
cache: npm
- run: npm install
- name: Bundle specification
run: npm run build -- ../public
- name: Deploy to release branch
uses: JamesIves/github-pages-deploy-action@4.1.4
with:
branch: release/v0
folder: ../public/api
target-folder: api
commit-message: release ${{ github.repository }}@${{ github.sha }} by ${{ github.actor }}

View File

@ -1 +0,0 @@
../../../../../privdoc/spec/definitions/RUSDomesticPassport.yaml

View File

@ -1 +0,0 @@
../../../../../privdoc/spec/definitions/RUSRetireeInsuranceCertificate.yaml

View File

@ -1 +0,0 @@
../../../../../privdoc/spec/definitions/SecuredPrivateDocument.yaml

View File

@ -1 +0,0 @@
../../../../../privdoc/spec/definitions/SecuredPrivateDocumentType.yaml