From 7192d9db2b3f121dc5fd713e4018bf0c638f5f46 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6ren=20Weber?= Date: Tue, 19 Oct 2021 17:24:41 +0200 Subject: [PATCH] task: run ci on PRs --- .../{deploy-gh-pages.yaml => ci.yaml} | 23 +++++++++---------- wercker.yml | 16 ------------- 2 files changed, 11 insertions(+), 28 deletions(-) rename .github/workflows/{deploy-gh-pages.yaml => ci.yaml} (51%) delete mode 100644 wercker.yml diff --git a/.github/workflows/deploy-gh-pages.yaml b/.github/workflows/ci.yaml similarity index 51% rename from .github/workflows/deploy-gh-pages.yaml rename to .github/workflows/ci.yaml index ce84061542..2fd8f3678e 100644 --- a/.github/workflows/deploy-gh-pages.yaml +++ b/.github/workflows/ci.yaml @@ -1,17 +1,16 @@ name: Deploy GitHub Pages on: - push: - branches: - - main # Set a branch to deploy - pull_request: - workflow_dispatch: + push: # Build on all pushes but only deploy for main branch + pull_request: # Build on all PRs regardless what branch + workflow_dispatch: # Allow this task to be manually started (you'll never know) jobs: - deploy: - runs-on: ubuntu-20.04 + ci: + name: Run CI + runs-on: ubuntu-latest steps: - - name: Checkout Site + - name: Checkout site uses: actions/checkout@v2 with: submodules: true # Fetch Hugo themes (true OR recursive) @@ -23,12 +22,12 @@ jobs: hugo-version: 'latest' # extended: true - - name: Build Site - run: hugo --minify --source exampleSite --destination ../public --baseURL https://mcshelby.github.io/hugo-theme-relearn/ + - name: Build site + run: hugo --minify --source exampleSite --destination ../public --cleanDestinationDir --gc --baseURL https://mcshelby.github.io/hugo-theme-relearn/ - - name: Deploy Site + - name: Deploy site + if: github.event_name == 'workflow_dispatch' or (github.event_name == 'push' and github.ref == 'refs/heads/main') uses: peaceiris/actions-gh-pages@v3 - if: github.ref == 'refs/heads/main' with: github_token: ${{ secrets.GITHUB_TOKEN }} publish_dir: ./public diff --git a/wercker.yml b/wercker.yml deleted file mode 100644 index e9d59b432f..0000000000 --- a/wercker.yml +++ /dev/null @@ -1,16 +0,0 @@ -box: golang -build: - steps: - # Gets the dependencies - - script: - name: get hugo - code: | - git clone https://github.com/gohugoio/hugo.git && cd hugo && go install - # Sets the go workspace and places you package - # at the right place in the workspace tree - - setup-go-workspace - # Build the project - - script: - name: build site - code: | - cd exampleSite && hugo \ No newline at end of file