Add initial implementation of build and deployment workflow #1
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: "Build and deploy the website" | |
on: | |
workflow_dispatch: | |
pull_request: | |
push: | |
branches: | |
- main | |
env: | |
HUGO_VERSION: 0.123.4 | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Download hugo | |
run: | | |
wget https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_${HUGO_VERSION}_Linux-64bit.tar.gz | |
tar -zxvf hugo_${HUGO_VERSION}_Linux-64bit.tar.gz hugo | |
- name: Build the website | |
run: ./hugo | |
- name: Set dry run | |
run: echo "DRY_RUN=${{ github.event_name == 'pull_request' && 'true' || 'false' }}" >> $GITHUB_ENV | |
- name: Deploy the website | |
uses: Dylan700/sftp-upload-action@latest | |
with: | |
username: webstage | |
host: web.ivoa.net | |
dry-run: ${{ env.DRY_RUN }} | |
uploads: | | |
./public/ => ./ivoa-web-stage/ |