Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add initial implementation of build and deployment workflow #7

Merged
merged 6 commits into from
Mar 5, 2024
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions .github/workflows/build_and_deploy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
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
server: web.ivoa.net
dry-run: ${{ env.DRY_RUN }}
key: ${{ secrets.STAGE_ID }}
uploads: |
./public/ => ./ivoa-web-stage/
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,7 @@ hugo_stats.json

# tmp hugo file
.hugo_build.lock

# ignore hugo in case you have installed it in the project directory
hugo
hugo*.tar.gz
Loading