Skip to content

Commit

Permalink
ci: add github action file
Browse files Browse the repository at this point in the history
  • Loading branch information
lbwa committed Mar 7, 2020
1 parent e67c1f9 commit 36e98ba
Show file tree
Hide file tree
Showing 3 changed files with 89 additions and 0 deletions.
49 changes: 49 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Deployment

on:
push:
branches:
- master

jobs:
build-and-deploy:
name: Build on node ${{ matrix.node_version }} and ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
node_version: [10.X]
os: [ubuntu-latest]

steps:
- uses: actions/checkout@v1

- name: Use Node.js ${{ matrix.node_version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node_version }}

- name: Use Yarn
run: |
npm i yarn -g
yarn -v
- name: Install Dependencies
run: yarn

- name: Build web site
run: yarn build

- name: Deploy output folder
env:
ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }}
BUILD_DIR: dist
TARGET_BRANCH: gh-pages
run: |
REMOTE_ORIGIN=https://${ACCESS_TOKEN}@github.com/${GITHUB_REPOSITORY}
cd ${BUILD_DIR}
git init
git config user.name ${GITHUB_ACTOR}
git config user.email "${GITHUB_ACTOR}@users.noreply.github.com"
git add . -f
git commit -m "deploy: from Github action - $(date +"%T")"
git push --force ${REMOTE_ORIGIN} master:${TARGET_BRANCH}
31 changes: 31 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Tests

on: [push]

jobs:
test:
name: Test on node ${{ matrix.node_version }} and ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
node_version: [10.X]
os: [ubuntu-latest]

steps:
- uses: actions/checkout@v1

- name: Use Node.js ${{ matrix.node_version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node_version }}

- name: Use Yarn
run: |
npm i yarn -g
yarn -v
- name: Install Dependencies
run: yarn

- name: Run all tests
run: yarn run test:unit
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
<h1 align="center">Vue auth boilerplate</h1>

<p align="center">
<a href="https://github.com/lbwa/vue-auth-boilerplate/actions">
<img alt="github actions - tests" src="https://github.com/lbwa/vue-auth-boilerplate/workflows/Tests/badge.svg">
</a>
<a href="https://lbwa.github.io/vue-auth-boilerplate">
<img alt="github actions - deployment" src="https://github.com/lbwa/vue-auth-boilerplate/workflows/Deployment/badge.svg">
</a>
</p>

`Vue.js` console boilerplate with authentication.

## Symbolic constants
Expand Down

0 comments on commit 36e98ba

Please sign in to comment.