Skip to content

add git workflow

add git workflow #1

name: Build and Deploy
on:
push:
branches:
- master
jobs:
build:
runs-on: ubuntu-latest
container:
image: registry.gitlab.com/pages/hugo/hugo_extended:latest
env:
GIT_SUBMODULE_STRATEGY: recursive
HUGO_ENV: production
steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
submodules: recursive
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y git
- name: Build
run: hugo
deploy:
runs-on: ubuntu-latest
needs: build
if: github.ref == 'refs/heads/master'
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Deploy to GitHub Pages
run: hugo
- name: Upload artifacts
uses: actions/upload-artifact@v2
with:
name: public
path: public