-
Notifications
You must be signed in to change notification settings - Fork 0
113 lines (106 loc) · 3.92 KB
/
jekyll.yml
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
# Sample workflow for building and deploying a Jekyll site to GitHub Pages
name: Deploy Jekyll site to Pages
on:
# Runs on pushes targeting the default branch
push:
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
id-token: write
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: ${{ github.ref }}
cancel-in-progress: true
jobs:
# Build job
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: make caches
run: |
mkdir cache
mkdir cache/resize
- name: Cache Images
uses: actions/cache/restore@v3
with:
path: cache
key: cache_test-${{ hashFiles('assets/**') }}
restore-keys: |
cache_test
- name: check cache
run: |
ls -l cache
ls -l cache/resize
- name: Setup node
uses: actions/setup-node@v4
- name: Setup Ruby
uses: ruby/setup-ruby@v1 # v1.161.0
with:
ruby-version: '3.2' # Not needed with a .ruby-version file
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
cache-version: 1 # Increment this number if you need to re-download cached gems
- name: Setup build dependencies
run: |
sudo apt-get update
sudo apt-get install graphicsmagick
npm ci
- name: Checks Ruby Gems
run: bundle list
- name: Checks npm packages
run: npm list
# - name: Setup Pages
# id: pages
# uses: actions/configure-pages@v4
- name: Build with Jekyll
# Outputs to the './_site' directory by default
id: build
run: npx gulp build
env:
JEKYLL_ENV: production
- name: Check HTML
uses: chabad360/htmlproofer@master
with:
directory: "./_site" #--enforce_https false <-- why doesn't this work?
arguments: --ignore-status-codes "999,403" --ignore_urls "/datascience.ucsd.edu/,/kastner.ucsd.edu/,/onlinedigeditions.com/,/e4e.ucsd.edu/,/jaffeweb.ucsd.edu/,/instagram.com/" --assume-extension .html --swap-urls '^https\://e4e.ucsd.edu/:/'
- name: Checks files
run: ls -l cache
- name: Checks files
run: ls -l assets
- name: remove extra cache
if: steps.build.outcome == 'success'
run: rm -rf cache/resize_temp
- name: Cache Images
uses: actions/cache/save@v3
if: always()
with:
path: cache
# this should not hash every file.... how do we connect this to a new cache?
key: cache_test-${{ hashFiles('assets/**') }}
deploy:
runs-on: ubuntu-latest
needs:
- build
if: github.ref == 'refs/heads/main'
steps:
- name: Execute Deploy
env:
SSH_PRIVATE_KEY: ${{secrets.KASTNER_ML_DEPLOY_SSH}}
SSH_KNOWN_HOSTS: ${{secrets.KASTNER_ML_KNOWN_HOSTS}}
SSH_KEY_PATH: ${{github.workspace}}/../private.key
run: |
mkdir -p ~/.ssh/
echo "$SSH_PRIVATE_KEY" > $SSH_KEY_PATH
sudo chmod 600 $SSH_KEY_PATH
echo "$SSH_KNOWN_HOSTS" > ~/.ssh/known_hosts
wget https://raw.githubusercontent.com/UCSD-E4E/website2.0/main/_deploy_e4e-dev.sh
scp -i $SSH_KEY_PATH _deploy_e4e-dev.sh [email protected]:/tmp/deploy_e4e-dev.sh
ssh -i $SSH_KEY_PATH [email protected] '/bin/bash /tmp/deploy_e4e-dev.sh'