From 8a56798c8b5f07b3ebfe4902c207664ae019082a Mon Sep 17 00:00:00 2001 From: Maik de Kruif Date: Wed, 10 Mar 2021 14:08:29 +0100 Subject: [PATCH 01/11] Setup automatic deployment --- .github/workflows/hugo_ci.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/hugo_ci.yml b/.github/workflows/hugo_ci.yml index 776c0be..bd70e27 100644 --- a/.github/workflows/hugo_ci.yml +++ b/.github/workflows/hugo_ci.yml @@ -4,7 +4,7 @@ on: push: branches: ["**"] pull_request: - branches: [master] + branches: [master, feature/ci] defaults: run: @@ -25,3 +25,9 @@ jobs: extended: true - name: Build run: hugo -D -F + - name: Deploy + uses: avakar/create-deployment@v1 + with: + auto_merge: false + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From ffc4ef50debf951c4c323c35589a62824561896c Mon Sep 17 00:00:00 2001 From: Maik de Kruif Date: Wed, 10 Mar 2021 14:22:10 +0100 Subject: [PATCH 02/11] Use other deployment method --- .github/workflows/hugo_ci.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/hugo_ci.yml b/.github/workflows/hugo_ci.yml index bd70e27..4c124b4 100644 --- a/.github/workflows/hugo_ci.yml +++ b/.github/workflows/hugo_ci.yml @@ -25,9 +25,9 @@ jobs: extended: true - name: Build run: hugo -D -F - - name: Deploy - uses: avakar/create-deployment@v1 + - name: Create GitHub deployment + uses: chrnorm/deployment-action@releases/v1 + id: deployment with: - auto_merge: false - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + token: "${{ github.token }}" + environment: production From 25e01b7217d4e6f6d191a5f3ee7fab4e88cadf0b Mon Sep 17 00:00:00 2001 From: Maik de Kruif Date: Wed, 10 Mar 2021 14:31:12 +0100 Subject: [PATCH 03/11] Add target url and state --- .github/workflows/hugo_ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/hugo_ci.yml b/.github/workflows/hugo_ci.yml index 4c124b4..676f550 100644 --- a/.github/workflows/hugo_ci.yml +++ b/.github/workflows/hugo_ci.yml @@ -30,4 +30,6 @@ jobs: id: deployment with: token: "${{ github.token }}" + target_url: https://maik.dev/ environment: production + state: "success" From 904e30a004ff0d914b35fa2ffa38752f56c5a53d Mon Sep 17 00:00:00 2001 From: Maik de Kruif Date: Wed, 10 Mar 2021 14:41:44 +0100 Subject: [PATCH 04/11] Fix status --- .github/workflows/hugo_ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/hugo_ci.yml b/.github/workflows/hugo_ci.yml index 676f550..ff341ab 100644 --- a/.github/workflows/hugo_ci.yml +++ b/.github/workflows/hugo_ci.yml @@ -32,4 +32,4 @@ jobs: token: "${{ github.token }}" target_url: https://maik.dev/ environment: production - state: "success" + initial_status: "success" From 72b6e8969562eacb6f0b6b4eb8fd1cf895aa0b81 Mon Sep 17 00:00:00 2001 From: Maik de Kruif Date: Wed, 10 Mar 2021 14:45:53 +0100 Subject: [PATCH 05/11] Test for backend --- hi | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 hi diff --git a/hi b/hi new file mode 100644 index 0000000..e69de29 From 5df8fe7fc9b2bc9f904d6ed8f68e7ec497b0d44d Mon Sep 17 00:00:00 2001 From: Maik de Kruif Date: Wed, 10 Mar 2021 14:48:30 +0100 Subject: [PATCH 06/11] Another backend test --- content/portfolio.md | 2 +- hi | 0 2 files changed, 1 insertion(+), 1 deletion(-) delete mode 100644 hi diff --git a/content/portfolio.md b/content/portfolio.md index b31718e..78b0573 100644 --- a/content/portfolio.md +++ b/content/portfolio.md @@ -15,4 +15,4 @@ categories = [ ## Coming soon -Please come back later. +Please come back later.x diff --git a/hi b/hi deleted file mode 100644 index e69de29..0000000 From 066a8f054f6a7d8a3e8e7d0170a38124539f1ca0 Mon Sep 17 00:00:00 2001 From: Maik de Kruif Date: Wed, 10 Mar 2021 14:51:10 +0100 Subject: [PATCH 07/11] Undo test changes --- content/portfolio.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/portfolio.md b/content/portfolio.md index 78b0573..b31718e 100644 --- a/content/portfolio.md +++ b/content/portfolio.md @@ -15,4 +15,4 @@ categories = [ ## Coming soon -Please come back later.x +Please come back later. From 593071dc9395f7249c23b5614508445ccc6ee579 Mon Sep 17 00:00:00 2001 From: Maik de Kruif Date: Wed, 10 Mar 2021 14:54:01 +0100 Subject: [PATCH 08/11] One more test --- content/portfolio.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/portfolio.md b/content/portfolio.md index b31718e..74fbe7f 100644 --- a/content/portfolio.md +++ b/content/portfolio.md @@ -15,4 +15,4 @@ categories = [ ## Coming soon -Please come back later. +Please come back later.s From 7718859c4ad9deeb462a4f57315e36151c2308c1 Mon Sep 17 00:00:00 2001 From: Maik de Kruif Date: Wed, 10 Mar 2021 15:12:11 +0100 Subject: [PATCH 09/11] Undo changes --- content/portfolio.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/portfolio.md b/content/portfolio.md index 74fbe7f..b31718e 100644 --- a/content/portfolio.md +++ b/content/portfolio.md @@ -15,4 +15,4 @@ categories = [ ## Coming soon -Please come back later.s +Please come back later. From 6592edf2fa9197c894f40dc153e1fc63e3982f3a Mon Sep 17 00:00:00 2001 From: Maik de Kruif Date: Wed, 10 Mar 2021 15:16:06 +0100 Subject: [PATCH 10/11] Only run on master branch --- .github/workflows/hugo_ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/hugo_ci.yml b/.github/workflows/hugo_ci.yml index ff341ab..f88d77b 100644 --- a/.github/workflows/hugo_ci.yml +++ b/.github/workflows/hugo_ci.yml @@ -4,7 +4,7 @@ on: push: branches: ["**"] pull_request: - branches: [master, feature/ci] + branches: [master] defaults: run: From a7e1bcf75e7c7465c410da866817a2eb33b89cd0 Mon Sep 17 00:00:00 2001 From: Maik de Kruif Date: Wed, 10 Mar 2021 15:20:41 +0100 Subject: [PATCH 11/11] 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"