2020-06-29 10:25:20 +09:00
|
|
|
name: CI/CD
|
2020-06-29 10:23:45 +09:00
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- '*'
|
|
|
|
- '!gh-pages'
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2020-06-29 10:25:20 +09:00
|
|
|
- name: Checkout
|
|
|
|
uses: actions/checkout@v1
|
2020-06-29 10:23:45 +09:00
|
|
|
- name: Create a new build
|
|
|
|
run: docker build -t publisher:latest -f ./dockerfiles/Deploy.Dockerfile .
|
|
|
|
deploy:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
needs: build
|
|
|
|
if: github.ref == 'refs/heads/master'
|
|
|
|
steps:
|
|
|
|
- name: Deploy to gh-pages branch
|
|
|
|
env:
|
2020-06-29 10:25:20 +09:00
|
|
|
REPOSITORY_TOKEN: ${{ secrets.REPOSITORY_TOKEN }}
|
2020-06-29 10:23:45 +09:00
|
|
|
PUBLISHER_NAME: ${{ secrets.PUBLISHER_NAME }}
|
|
|
|
PUBLISHER_EMAIL: ${{ secrets.PUBLISHER_EMAIL }}
|
|
|
|
run: |
|
|
|
|
docker run \
|
|
|
|
--rm \
|
2020-06-29 10:25:20 +09:00
|
|
|
-e REPOSITORY_TOKEN="$env:REPOSITORY_TOKEN" \
|
2020-06-29 10:23:45 +09:00
|
|
|
-e PUBLISHER_NAME="$env:PUBLISHER_NAME" \
|
|
|
|
-e PUBLISHER_EMAIL="$env:PUBLISHER_EMAIL" \
|
|
|
|
publisher:latest
|