Separate ci and cd tasks

pull/4/head
Maik de Kruif 4 years ago
parent 6592edf2fa
commit a7e1bcf75e
No known key found for this signature in database
GPG Key ID: 50FA6EF181702794
  1. 34
      .github/workflows/hugo_cd.yml
  2. 23
      .github/workflows/hugo_ci.yml

@ -0,0 +1,34 @@
name: Hugo CD
on:
push:
branches:
- "master"
defaults:
run:
working-directory: ./
jobs:
cd:
timeout-minutes: 6
name: CD
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Setup hugo
uses: peaceiris/actions-hugo@v2
with:
hugo-version: "latest"
extended: true
- name: Build
run: hugo -D -F
- name: Create GitHub deployment
uses: chrnorm/deployment-action@releases/v1
id: deployment
with:
token: "${{ github.token }}"
target_url: https://maik.dev/
environment: production
initial_status: "success"

@ -2,18 +2,23 @@ name: Hugo CI
on: on:
push: push:
branches: ["**"] branches:
- "*"
- "*/*"
- "**"
- "!master"
pull_request: pull_request:
branches: [master] branches:
- "master"
defaults: defaults:
run: run:
working-directory: ./ working-directory: ./
jobs: jobs:
compile: ci:
timeout-minutes: 10 timeout-minutes: 5
name: Compile name: CI
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Checkout code - name: Checkout code
@ -25,11 +30,3 @@ jobs:
extended: true extended: true
- name: Build - name: Build
run: hugo -D -F run: hugo -D -F
- name: Create GitHub deployment
uses: chrnorm/deployment-action@releases/v1
id: deployment
with:
token: "${{ github.token }}"
target_url: https://maik.dev/
environment: production
initial_status: "success"

Loading…
Cancel
Save