mirror of
https://github.com/McShelby/hugo-theme-relearn.git
synced 2024-11-27 01:33:04 +00:00
task: run ci on PRs
This commit is contained in:
parent
0d3c097f8c
commit
7192d9db2b
2 changed files with 11 additions and 28 deletions
|
@ -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
|
16
wercker.yml
16
wercker.yml
|
@ -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
|
Loading…
Reference in a new issue