Skip to content

Commit

Permalink
feat(SemVer): Added Semantic Versioning
Browse files Browse the repository at this point in the history
Simplified the CI job,
Pull Requests will only trigger a simple mkdocs build to check for
errors
Merges/Push Will trigger docker build with semantic versioning
New image gets deployed withing minutes of being published
  • Loading branch information
coolapso committed Oct 23, 2021
1 parent c40afae commit 2627445
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 23 deletions.
42 changes: 19 additions & 23 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
os: linux
dist: focal
language: python

services:
- docker

stages:
- test
- name: "BuildTest"
if: branch = test
- name: "Build&Publish"
- name: "release"
if: branch = master

jobs:
Expand All @@ -20,27 +19,24 @@ jobs:
script:
- mkdocs build

- stage: "BuildTest"
name: "BuildTest"
- stage: "publish"
name: "publish"
if: type = push
before_script:
- echo $dockerpass | docker login -u $dockeruser --password-stdin
env:
- IMAGE=pivpn/docs
before_install:
- apt update
- apt install -y curl
- curl -fsSL https://deb.nodesource.com/setup_17.x | bash -
- apt-get install -y nodejs
install:
- pip install mkdocs-material
script:
- mkdocs build
- docker build -t $prrepo:$tag .
- docker push $prrepo:$tag


- stage: "Build&Publish"
name: "Build&Deploy"
if: type = push
- npm install @semantic-release/github -D
- npm install @semantic-release/changelog -D
- npm install @semantic-release-plus/docker -D
before_script:
- echo $dockerpass | docker login -u $dockeruser --password-stdin
install:
- pip install mkdocs-material
- echo $DOCKER_PASSWORD | docker login -u $DOCKER_USERNAME --password-stdin
script:
- mkdocs build
- docker build -t $docsrepo:$tag .
- docker push $docsrepo:$tag
- docker build -t $IMAGE .
- npx semantic-release

2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
![Pivpn Banner](docs/img/pivpnbanner.png)

[![Build Status](https://travis-ci.com/pivpn/docs.svg?branch=master)](https://travis-ci.com/pivpn/docs)
[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)


## Documentation & User Guides

Expand Down

0 comments on commit 2627445

Please sign in to comment.