Merge pull request #3 from ewpratten/github_ci
Cleaner GitHub CI scripts
This commit is contained in:
commit
6c1edacc0f
@ -1,5 +1,13 @@
|
|||||||
name: Bundle Website
|
name: Build Website
|
||||||
on: push
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- "*"
|
||||||
|
# Master has its own set of build rules,
|
||||||
|
# and will eventually call this script on its own
|
||||||
|
- "!master"
|
||||||
|
workflow_call:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
@ -33,29 +41,5 @@ jobs:
|
|||||||
- name: Publish site as artifact
|
- name: Publish site as artifact
|
||||||
uses: actions/upload-artifact@v2
|
uses: actions/upload-artifact@v2
|
||||||
with:
|
with:
|
||||||
name: website
|
name: website-static-bundle
|
||||||
path: ./public
|
path: ./public
|
||||||
|
|
||||||
deploy:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
needs: build
|
|
||||||
if: github.ref == 'refs/heads/master'
|
|
||||||
steps:
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@v2
|
|
||||||
|
|
||||||
- name: Download website bundle
|
|
||||||
uses: actions/download-artifact@v2
|
|
||||||
with:
|
|
||||||
name: website
|
|
||||||
path: ./public
|
|
||||||
|
|
||||||
- name: Deploy to GitHub Pages
|
|
||||||
if: success()
|
|
||||||
uses: crazy-max/ghaction-github-pages@v2
|
|
||||||
with:
|
|
||||||
target_branch: gh-pages
|
|
||||||
build_dir: public
|
|
||||||
fqdn: ewpratten.com
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
29
.github/workflows/deploy.yml
vendored
Normal file
29
.github/workflows/deploy.yml
vendored
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
name: Deploy
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- "master"
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
uses: ./.github/workflows/build.yml
|
||||||
|
|
||||||
|
deploy:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
needs: build
|
||||||
|
steps:
|
||||||
|
- name: Download bundle artifact
|
||||||
|
uses: actions/download-artifact@v2
|
||||||
|
with:
|
||||||
|
name: website
|
||||||
|
path: ./public
|
||||||
|
|
||||||
|
- name: Deploy to GitHub Pages
|
||||||
|
if: success()
|
||||||
|
uses: crazy-max/ghaction-github-pages@v2
|
||||||
|
with:
|
||||||
|
target_branch: gh-pages
|
||||||
|
build_dir: public
|
||||||
|
fqdn: ewpratten.com
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
Loading…
x
Reference in New Issue
Block a user