Skip to content

CI

CI #13

Workflow file for this run

# This is a basic workflow to help you get started with Actions
name: CI
env:
HUGO_VERSION: 0.80.0
# Controls when the action will run.
on:
# Triggers the workflow on push or pull request events but only for the master branch
push:
branches: [ master ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
# https://github.com/marketplace/actions/configure-aws-credentials-action-for-github-actions
- 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: Install Hugo
env:
HUGO_TARBALL: hugo_${{ env.HUGO_VERSION }}_Linux-64bit.tar.gz
run: |
wget https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/${HUGO_TARBALL}
tar -xvzf $HUGO_TARBALL
- name: Build website
run: ./hugo
- name: Deploy website
env:
MEGGIELCOM_BUCKET_NAME: ${{ secrets.MEGGIELCOM_BUCKET_NAME }}
run:
aws s3 sync public/ s3://${MEGGIELCOM_BUCKET_NAME}/ --delete --exclude "maryland-farms/*"