Skip to content

Commit

Permalink
feat: example page
Browse files Browse the repository at this point in the history
  • Loading branch information
avil13 committed Oct 25, 2020
1 parent a2820b6 commit 3ba010e
Show file tree
Hide file tree
Showing 20 changed files with 13,409 additions and 28 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/gh-page.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: gh-page

on:
push:
branches:
- master

defaults:
run:
shell: bash
working-directory: packages/example

jobs:
publish-example-site:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1

- uses: actions/setup-node@v1
with:
node-version: 12
registry-url: https://registry.npmjs.org/

# Проверяем изменилась ли версия
- name: Set NEED_PUBLISH
run: echo "NEED_PUBLISH=$(./need-publish.sh)" >> $GITHUB_ENV

- name: Install and Build - ⌛&🏗️
if: ${{ env.NEED_PUBLISH }}
run: |
npm ci
npm run build
- name: Deploy 🚀.🚀.🚀
if: ${{ env.NEED_PUBLISH }}
uses: JamesIves/github-pages-deploy-action@releases/v3
with:
ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }}
BRANCH: gh-pages # The branch the action should deploy to.
FOLDER: packages/example/dist # The folder the action should deploy.
CLEAN: true
4 changes: 2 additions & 2 deletions .github/workflows/npmpublish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ jobs:
with:
node-version: 12
registry-url: https://registry.npmjs.org/
# Проверяем изменилась ли версия
# Проверяем изменилась ли версия
- name: Set NEED_PUBLISH
run: echo ::set-env name=NEED_PUBLISH::$(./need-publish.sh)
run: echo "NEED_PUBLISH=$(./need-publish.sh)" >> $GITHUB_ENV

- run: yarn
if: ${{ env.NEED_PUBLISH }}
Expand Down
6 changes: 6 additions & 0 deletions packages/example/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
node_modules
.DS_Store
dist
*.local
!package-lock.json
yarn.lock
18 changes: 18 additions & 0 deletions packages/example/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<link rel="icon" href="./favicon.ico" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>vue-sweetalert2 example</title>
</head>
<body>
<noscript>
<strong>We're sorry but vue-sweetalert2-example doesn't work properly without JavaScript enabled. Please enable it to
continue.</strong>
</noscript>
<div id="app"></div>
<script type="module" src="/src/main.js"></script>
</body>
</html>
14 changes: 14 additions & 0 deletions packages/example/need-publish.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/bash

# PKG=$(node -p -e "require('./package.json').name")
PKG="vue-sweetalert2"

# we get the version of the package in a branch
CURRENT_VERSION=$(node -p -e "require('./package.json').version")
PUBLIC_VERSION=$(npm show ${PKG} version)


if [[ $CURRENT_VERSION != $PUBLIC_VERSION ]];
then
echo 'TRUE';
fi
Loading

0 comments on commit 3ba010e

Please sign in to comment.