Skip to content

Commit

Permalink
add github action
Browse files Browse the repository at this point in the history
  • Loading branch information
l10178 committed Jan 27, 2021
1 parent 28c1890 commit a012d3d
Show file tree
Hide file tree
Showing 6 changed files with 102 additions and 38 deletions.
62 changes: 62 additions & 0 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: docker publish

on:
push:
# Publish `v1.2.3` tags as releases.
tags:
- v*

# Run tests for any PRs.
pull_request:

env:
IMAGE_NAME: idaas-book

jobs:
# Push image to GitHub Packages.
# See also https://docs.docker.com/docker-hub/builds/
push:
runs-on: ubuntu-latest
if: github.event_name == 'push'

steps:
- uses: actions/checkout@v2
with:
submodules: true # Fetch Hugo themes (true OR recursive)
fetch-depth: 0 # Fetch all history for .GitInfo and .Lastmod

- name: Setup Hugo
uses: peaceiris/actions-hugo@v2
with:
hugo-version: '0.80.0'

- name: Build
run: hugo --minify --baseURL /idaas-book

- name: Build image
run: docker build . --file Dockerfile --tag $IMAGE_NAME

- name: Log into registry
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login docker.pkg.github.com -u ${{ github.actor }} --password-stdin

- name: Push image
run: |
IMAGE_ID=docker.pkg.github.com/${{ github.repository }}/$IMAGE_NAME
# Change all uppercase to lowercase
IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]')
# Strip git ref prefix from version
VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,')
# Strip "v" prefix from tag name
[[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//')
# Use Docker `latest` tag convention
[ "$VERSION" == "main" ] && VERSION=latest
echo IMAGE_ID=$IMAGE_ID
echo VERSION=$VERSION
docker tag $IMAGE_NAME $IMAGE_ID:$VERSION
docker push $IMAGE_ID:$VERSION
29 changes: 29 additions & 0 deletions .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: github pages

on:
push:
branches:
- main # Set a branch name to trigger deployment

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
submodules: true # Fetch Hugo themes (true OR recursive)
fetch-depth: 0 # Fetch all history for .GitInfo and .Lastmod

- name: Setup Hugo
uses: peaceiris/actions-hugo@v2
with:
hugo-version: '0.80.0'

- name: Build
run: hugo --minify --baseURL https://l10178.github.io/idaas-book/

- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./public
25 changes: 0 additions & 25 deletions .travis.yml

This file was deleted.

2 changes: 2 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
FROM nginx:1.18.0-alpine
COPY ./public /usr/share/nginx/html/idaas-book
16 changes: 7 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# idaas-book

[![Build Status](https://travis-ci.com/l10178/idaas-book.svg?branch=master)](https://travis-ci.com/l10178/idaas-book)
[![Hugo Version](https://img.shields.io/badge/hugo-0.79-blue.svg)](https://gohugo.io)
![Build status](https://github.com/l10178/idaas-book/workflows/github%20pages/badge.svg?branch=main)
[![Hugo Version](https://img.shields.io/badge/hugo-0.80-blue.svg)](https://gohugo.io)
[![GitHub release](https://img.shields.io/github/v/release/l10178/idaas-book)](https://github.com/l10178/idaas-book/releases/latest)
[![GitHub contributors](https://img.shields.io/github/contributors/l10178/idaas-book)](https://github.com/l10178/idaas-book/graphs/contributors)
[![License: MIT](https://img.shields.io/github/license/l10178/idaas-book)](LICENSE)
[![License](https://img.shields.io/github/license/l10178/idaas-book)](LICENSE)

A book about identity as a service (IDaaS).

Expand All @@ -17,20 +17,18 @@ A book about identity as a service (IDaaS).
hugo new folder/name.md
# 本地启动 Server
hugo server -D
# 发布
hugo
```

## Roadmap

- IDaaS
- Keycloak
- OAuth2
- OIDC
- CAS
- Keycloak
- Dex
- LDAP/AD/kerberos
- SAML
- OIDC

## Thanks

Expand All @@ -42,6 +40,6 @@ A book about identity as a service (IDaaS).

## License

Licensed under Apache License 2.0. Copyright (c) 2020 [idaas.site][].
Licensed under Apache License 2.0. Copyright (c) 2020 [nxest.com][].

[idaas.site]: https://www.idaas.site
[nxest.com]: https://www.nxest.com
6 changes: 2 additions & 4 deletions themes/hugo-geekdoc/layouts/partials/site-footer.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
<footer class="gdoc-footer">
<div class="container flex flex-wrap">
<span class="gdoc-footer__item">
Copyright © 2020 <a href="https://www.idaas.site" class="gdoc-footer__link">idaas.site</a>.
</span>
<span class="gdoc-footer__item"> Copyright © 2020 <a href="https://www.nxest.com" class="gdoc-footer__link">nxest.com</a>. </span>
</div>
</footer>
</footer>

0 comments on commit a012d3d

Please sign in to comment.