This repository was archived by the owner on Aug 15, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 20
53 lines (43 loc) · 1.54 KB
/
deploy-production-osg-htc.yml
File metadata and controls
53 lines (43 loc) · 1.54 KB
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
name: Deploy production version of the Website on osg-htc Repo
on:
push:
branches:
- master
schedule:
- cron: '0 0 * * *'
jobs:
Build-And-Deploy-Production:
if: ${{ github.repository_owner == 'opensciencegrid' }}
runs-on: ubuntu-18.04
env:
CNAME: osg-htc.org
production_url: https://github.com/opensciencegrid/osg-htc.git
OVERRIDE_CONFIG: _config_osg-htc_org.yml
steps:
- uses: actions/checkout@v2
with:
submodules: 'recursive'
- name: Setup SSH Keys and known_hosts
uses: webfactory/ssh-agent@v0.5.3
with:
ssh-private-key: ${{ secrets.OSG_HTC_DEPLOY_KEY }}
- name: Initialize GH User
run: |
git config user.name "GitHub Actions"
git config user.email "actions@github.com"
- uses: ruby/setup-ruby@v1
with:
ruby-version: 2.6
bundler-cache: true
- name: Build and Deploy
run: |
# Build the production version of website
JEKYLL_ENV=production bundle exec jekyll build --config _config.yml,${{ env.OVERRIDE_CONFIG }}
# Add in the appropriate CNAME file
echo "${{ env.CNAME }}" > _site/CNAME
# Commit the build then use 'git subtree' to create a branch with just the _site contents
git add _site -f
git commit -m "Build Production Website"
git checkout -b split-branch `git subtree split --prefix _site master`
# Push to Production
git push ${{ env.production_url }} HEAD:main --force