Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
23 changes: 23 additions & 0 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name-template: "v$RESOLVED_VERSION"
tag-template: "v$RESOLVED_VERSION"
categories:
- title: "📚 Content Changes"
labels:
- "blog"
- "documentation"
- title: "🚀 Features"
labels:
- "enhancement"
- "feature"
- title: "🐛 Bugs Fixes"
labels:
- "bug"
- title: "🧰 Development"
labels:
- "chore"
change-template: "- #$NUMBER $TITLE"
change-title-escapes: '\<*_&`#@'
template: |
$CHANGES

Thanks to $CONTRIBUTORS
83 changes: 83 additions & 0 deletions .github/workflows/blog.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
name: blog

on:
push:
paths: # run only when an Rmd file changes
- "**.Rmd"
- "environment.yml"
- ".github/workflows/ci.yaml"

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
# submodules: true # Fetch Hugo themes (true OR recursive)
fetch-depth: 3
- name: Cache Conda
uses: actions/cache@v1
with:
path: ~/conda_pkgs_dir
key: ${{ runner.os }}-conda6-${{ hashFiles('environment.yml') }}
restore-keys: |
${{ runner.os }}-conda6-
- uses: conda-incubator/setup-miniconda@v2
with:
python-version: 3.9
mamba-version: "*"
channels: conda-forge,defaults
channel-priority: true
activate-environment: www-main
environment-file: environment.yml
auto-activate-base: false
use-only-tar-bz2: true # IMPORTANT: This needs to be set for caching to work properly!
# - name: Conda info
# shell: bash -l {0}
# run: |
# conda info
# conda list
- name: Install R dependencies
shell: bash -l {0}
run: |
Rscript ./dependencies.R
- name: Restore Blogdown Cache
uses: actions/cache@v2
with:
path: |
./blogdown
key: ${{ runner.os }}-blogdown2-${{ hashFiles('environment.yml') }}-${{ hashFiles('content/blog/**.Rmd') }}
restore-keys: |
${{ runner.os }}-blogdown2-${{ hashFiles('environment.yml') }}-
${{ runner.os }}-blogdown2-
- name: Build site
shell: bash -l {0}
run: |
npm run build:blog

- uses: actions/upload-artifact@v2
with:
name: blog
path: |
./content/blog
./static/blog

- uses: actions/setup-node@v1
with:
node-version: "12"
- uses: actions/cache@v2
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- run: npm ci
- name: Lint
run: npm run lint
- name: Build
run: npm run build

- uses: actions/upload-artifact@v2
with:
name: website
path: ./public
116 changes: 58 additions & 58 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -1,76 +1,25 @@
on:
push:
paths: # run only when an Rmd file changes
- "**.Rmd"
- "environment.yml"
- ".github/workflows/ci.yaml"

name: ci

on: push

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
# submodules: true # Fetch Hugo themes (true OR recursive)
fetch-depth: 3
- name: Cache Conda
uses: actions/cache@v1
with:
path: ~/conda_pkgs_dir
key: ${{ runner.os }}-conda6-${{ hashFiles('environment.yml') }}
restore-keys: |
${{ runner.os }}-conda6-
- uses: conda-incubator/setup-miniconda@v2
with:
python-version: 3.9
mamba-version: "*"
channels: conda-forge,defaults
channel-priority: true
activate-environment: www-main
environment-file: environment.yml
auto-activate-base: false
use-only-tar-bz2: true # IMPORTANT: This needs to be set for caching to work properly!
# - name: Conda info
# shell: bash -l {0}
# run: |
# conda info
# conda list
- name: Install R dependencies
shell: bash -l {0}
run: |
Rscript ./dependencies.R
- name: Restore Blogdown Cache
uses: actions/cache@v2
with:
path: |
./blogdown
key: ${{ runner.os }}-blogdown2-${{ hashFiles('environment.yml') }}-${{ hashFiles('content/blog/**.Rmd') }}
restore-keys: |
${{ runner.os }}-blogdown2-${{ hashFiles('environment.yml') }}-
${{ runner.os }}-blogdown2-
- name: Build site
shell: bash -l {0}
run: |
npm run build:blog

- uses: actions/upload-artifact@v2
with:
name: blog
path: |
./content/blog
./static/blog
fetch-depth: 3 # Fetch all history for .GitInfo and .Lastmod

- uses: actions/setup-node@v1
- uses: actions/setup-node@v2.1.5
with:
node-version: "12"
node-version: "14"
- uses: actions/cache@v2
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
key: ${{ runner.os }}-node3-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
${{ runner.os }}-node3-
- run: npm ci
- name: Lint
run: npm run lint
Expand All @@ -81,3 +30,54 @@ jobs:
with:
name: website
path: ./public

image:
needs: build
# only on tags and dev branch
if: startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/dev'
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v2
- name: Login to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: cmu-delphi-deploy-machine
password: ${{ secrets.CMU_DELPHI_DEPLOY_MACHINE_PAT }}
- name: Build Image
env:
DEVOPS_DOCKER_FILE: ./devops/Dockerfile
run: |
docker build -t repo --file ${DEVOPS_DOCKER_FILE} .
- name: Resolve Tag
id: tagname
run: |
baseRef="${GITHUB_REF#*/}"
imageTag="${baseRef#*/}"
echo -n "::set-output name=tag::$imageTag"
echo -n "::set-output name=repo::ghcr.io/${{ github.repository }}"
- name: Push Image Tag
run: |
docker tag repo ${{ steps.tagname.outputs.repo }}:${{ steps.tagname.outputs.tag }}
docker push ${{ steps.tagname.outputs.repo }}:${{ steps.tagname.outputs.tag }}
- name: Trigger Webhook
run: |
# trigger a webhook update
curl -H "Authorization: Bearer ${{ secrets.DELPHI_DEPLOY_WEBHOOK_TOKEN }}" \
-X POST ${{ secrets.DELPHI_DEPLOY_WEBHOOK_URL }} \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "repository=${{ steps.tagname.outputs.repo }}&tag=${{ steps.tagname.outputs.tag }}"
- name: Push Latest Tag
if: startsWith(github.ref, 'refs/tags/v')
run: |
docker tag repo ${{ steps.tagname.outputs.repo }}:latest
docker push ${{ steps.tagname.outputs.repo }}:latest
- name: Trigger Latest Webhook
if: startsWith(github.ref, 'refs/tags/v')
run: |
# trigger a webhook update
curl -H "Authorization: Bearer ${{ secrets.DELPHI_DEPLOY_WEBHOOK_TOKEN }}" \
-X POST ${{ secrets.DELPHI_DEPLOY_WEBHOOK_URL }} \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "repository=${{ steps.tagname.outputs.repo }}&tag=latest"
70 changes: 0 additions & 70 deletions .github/workflows/ci_fast.yaml

This file was deleted.

38 changes: 38 additions & 0 deletions .github/workflows/create_release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Create Release
on:
workflow_dispatch:
inputs:
versionName:
description: "Semantic Version Number (i.e., 5.5.0 or patch, minor, major, prepatch, preminor, premajor, prerelease)"
required: true
default: patch
jobs:
create_release:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v2
with:
ref: main
ssh-key: ${{ secrets.CMU_DELPHI_DEPLOY_MACHINE_SSH }}
- name: Reset main branch
run: |
git fetch origin dev:dev
git reset --hard dev
- name: Change version number
id: version
run: |
echo -n "::set-output name=next_tag::"
npm version --no-git-tag-version ${{ github.event.inputs.versionName }}
- name: Create pull request into main
uses: peter-evans/create-pull-request@v3
with:
branch: release/${{ steps.version.outputs.next_tag }}
commit-message: "chore: release ${{ steps.version.outputs.next_tag }}"
base: main
title: Release ${{ steps.version.outputs.next_tag }}
labels: chore
reviewers: krivard,sgratzl
assignees: sgratzl
body: |
Releasing ${{ steps.version.outputs.next_tag }}.
Loading