-
Notifications
You must be signed in to change notification settings - Fork 4
54 lines (45 loc) · 1.43 KB
/
build_and_deploy.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
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: Extract branch name
shell: bash
run: echo "BRANCH_NAME=${{ github.head_ref }} | sed 's/\//-/g')" >> $GITHUB_ENV
- name: Debug print branch name
shell: bash
run: echo ${{ env.BRANCH_NAME }}
# - name: Upload the branch version of the website
# uses: Dylan700/sftp-upload-action@latest
# with:
# username: webstage
# server: web.ivoa.net
# key: ${{ secrets.STAGE_ID }}
# uploads: |
# ./public/ => ./ivoa-web-stage/v/${{ env.BRANCH_NAME }}
# if: github.event_name == 'pull_request'
- name: Deploy the website
uses: Dylan700/sftp-upload-action@latest
with:
username: webstage
server: web.ivoa.net
key: ${{ secrets.STAGE_ID }}
uploads: |
./public/ => ./ivoa-web-stage/
if: github.event_name != 'pull_request'