Merge pull request #52 from softinio/github-workflow-changes
Separate build and deploy jobs for github actions
This commit is contained in:
commit
a4163fb50e
2 changed files with 33 additions and 28 deletions
29
.github/workflows/build.yml
vendored
29
.github/workflows/build.yml
vendored
|
@ -1,10 +1,7 @@
|
||||||
name: Build and Deploy
|
name: Build
|
||||||
|
|
||||||
on:
|
on:
|
||||||
pull_request:
|
pull_request:
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- master
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
|
@ -21,27 +18,3 @@ jobs:
|
||||||
- name: Hugo Build
|
- name: Hugo Build
|
||||||
run: hugo --minify
|
run: hugo --minify
|
||||||
|
|
||||||
deploy:
|
|
||||||
name: Deploy
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
needs: [build]
|
|
||||||
if: github.event_name != 'pull_request'
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v2.3.4
|
|
||||||
with:
|
|
||||||
fetch-depth: 0
|
|
||||||
- uses: peaceiris/actions-hugo@v2
|
|
||||||
with:
|
|
||||||
hugo-version: '0.104.3'
|
|
||||||
extended: true
|
|
||||||
|
|
||||||
- name: Configure AWS Credentials
|
|
||||||
uses: aws-actions/configure-aws-credentials@v1
|
|
||||||
with:
|
|
||||||
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
|
|
||||||
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
|
||||||
aws-region: us-east-1
|
|
||||||
|
|
||||||
- name: Deploy to S3
|
|
||||||
run: hugo deploy --maxDeletes -1 --invalidateCDN
|
|
||||||
|
|
||||||
|
|
32
.github/workflows/deploy.yml
vendored
Normal file
32
.github/workflows/deploy.yml
vendored
Normal file
|
@ -0,0 +1,32 @@
|
||||||
|
name: Deploy
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- master
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
deploy:
|
||||||
|
name: Build
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- name: Setup Hugo
|
||||||
|
uses: peaceiris/actions-hugo@v2
|
||||||
|
with:
|
||||||
|
hugo-version: '0.104.3'
|
||||||
|
extended: true
|
||||||
|
|
||||||
|
- name: Hugo Build
|
||||||
|
run: hugo --minify
|
||||||
|
|
||||||
|
- name: Configure AWS Credentials
|
||||||
|
uses: aws-actions/configure-aws-credentials@v1
|
||||||
|
with:
|
||||||
|
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
|
||||||
|
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
||||||
|
aws-region: us-east-1
|
||||||
|
|
||||||
|
- name: Deploy to S3
|
||||||
|
run: hugo deploy --maxDeletes -1 --invalidateCDN
|
||||||
|
|
Loading…
Reference in a new issue