-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #11 from ivoa/iss10
Upload the branch version of the website for pull requests
- Loading branch information
Showing
4 changed files
with
86 additions
and
39 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
name: 'Download and extract Hugo' | ||
description: 'Downloads and extracts a specified version of Hugo' | ||
inputs: | ||
hugo_version: | ||
description: 'Version of Hugo to download' | ||
required: false | ||
default: '0.123.4' | ||
runs: | ||
using: 'composite' | ||
steps: | ||
- name: Cache Hugo | ||
uses: actions/cache@v2 | ||
with: | ||
path: ~/hugo | ||
key: ${{ runner.os }}-hugo-${{ inputs.hugo_version }} | ||
- name: Download and extract Hugo | ||
run: | | ||
if [ ! -f ~/hugo ]; then | ||
wget https://github.com/gohugoio/hugo/releases/download/v${{ inputs.hugo_version }}/hugo_${{ inputs.hugo_version }}_Linux-64bit.tar.gz | ||
tar -zxvf hugo_${{ inputs.hugo_version }}_Linux-64bit.tar.gz | ||
mv hugo ~/hugo | ||
fi | ||
shell: bash |
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
name: "Deploy the main version of the website" | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
deploy: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
|
||
- name: Setup Hugo | ||
uses: ./.github/actions/setup-hugo | ||
|
||
- name: Build the website | ||
run: ~/hugo | ||
|
||
- 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/ |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
name: "Deploy a branch version of the website" | ||
|
||
on: | ||
pull_request: | ||
|
||
jobs: | ||
deploy: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
|
||
- name: Extract branch name | ||
shell: bash | ||
run: echo "BRANCH_NAME=$(echo ${{ github.head_ref }} | sed 's/\//-/g')" >> $GITHUB_ENV | ||
|
||
- name: Debug print branch name | ||
shell: bash | ||
run: echo "BRANCH_NAME=${{ env.BRANCH_NAME }}" | ||
|
||
- name: Setup Hugo | ||
uses: ./.github/actions/setup-hugo | ||
|
||
- name: Build the website | ||
run: ~/hugo -b https://webtest.ivoa.info/v/${{ 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 }} |