task: run ci on PRs

This commit is contained in:
Sören Weber 2021-10-19 17:24:41 +02:00
parent 0d3c097f8c
commit 7192d9db2b
No known key found for this signature in database
GPG key ID: 07D17FF580AE7589
2 changed files with 11 additions and 28 deletions

View file

@ -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

View file

@ -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