From a7e1bcf75e7c7465c410da866817a2eb33b89cd0 Mon Sep 17 00:00:00 2001 From: Maik de Kruif Date: Wed, 10 Mar 2021 15:20:41 +0100 Subject: [PATCH] Separate ci and cd tasks --- .github/workflows/hugo_cd.yml | 34 ++++++++++++++++++++++++++++++++++ .github/workflows/hugo_ci.yml | 23 ++++++++++------------- 2 files changed, 44 insertions(+), 13 deletions(-) create mode 100644 .github/workflows/hugo_cd.yml diff --git a/.github/workflows/hugo_cd.yml b/.github/workflows/hugo_cd.yml new file mode 100644 index 0000000..078dce2 --- /dev/null +++ b/.github/workflows/hugo_cd.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" diff --git a/.github/workflows/hugo_ci.yml b/.github/workflows/hugo_ci.yml index f88d77b..ff1de22 100644 --- a/.github/workflows/hugo_ci.yml +++ b/.github/workflows/hugo_ci.yml @@ -2,18 +2,23 @@ name: Hugo CI on: push: - branches: ["**"] + branches: + - "*" + - "*/*" + - "**" + - "!master" pull_request: - branches: [master] + branches: + - "master" defaults: run: working-directory: ./ jobs: - compile: - timeout-minutes: 10 - name: Compile + ci: + timeout-minutes: 5 + name: CI runs-on: ubuntu-latest steps: - name: Checkout code @@ -25,11 +30,3 @@ jobs: 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"