Skip to content

Merge branch 'master' into update-build-pipeline #6256

Merge branch 'master' into update-build-pipeline

Merge branch 'master' into update-build-pipeline #6256

Workflow file for this run

# Builds a preview of all non-master branches and publishes them
# to https://aclanthology.org/previews/BRANCHNAME
name: preview
on:
push:
branches:
- '**'
- '!master'
- '!python-*'
# only run one at a time per branch
concurrency:
group: preview-${{ github.ref }}
cancel-in-progress: true
jobs:
preview:
if: github.repository == 'acl-org/acl-anthology'
runs-on:
labels: ubuntu-latest-m
env:
HUGO_VERSION: 0.156.0
DART_SASS_VERSION: 1.97.1
steps:
- name: install hugo
run: wget "https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_linux-amd64.deb" && sudo dpkg -i "hugo_extended_${HUGO_VERSION}_linux-amd64.deb"
- name: Install Dart Sass
run: |
mkdir -p "${HOME}/.local"
curl -sLJO "https://github.com/sass/dart-sass/releases/download/${DART_SASS_VERSION}/dart-sass-${DART_SASS_VERSION}-linux-x64.tar.gz"
tar -C "${HOME}/.local" -xf "dart-sass-${DART_SASS_VERSION}-linux-x64.tar.gz"
rm "dart-sass-${DART_SASS_VERSION}-linux-x64.tar.gz"
echo "${HOME}/.local/dart-sass" >> "${GITHUB_PATH}"
- name: install uv
uses: astral-sh/setup-uv@v7
- name: update
run: sudo apt-get update
- name: install other deps
run: sudo apt-get install -y jing bibutils openssh-client rsync libyaml-dev libpython3-dev
- name: dump secret key
env:
SSH_KEY: ${{ secrets.PUBLISH_SSH_KEY }}
run: |
mkdir -p $HOME/.ssh/
echo "$SSH_KEY" > $HOME/.ssh/id_rsa
chmod 600 $HOME/.ssh/id_rsa
- uses: actions/checkout@v3
- name: fetch master branch
run: |
git fetch origin master
- name: install pip dependencies
run: |
python -m pip install -U pip
python -m pip install lxml
- name: extract branch name
shell: bash
run: |
raw_branch="${GITHUB_REF#refs/heads/}"
branch="${raw_branch//\//___}"
echo "branch=$(echo ${branch})" >> $GITHUB_OUTPUT
id: extract_branch
- name: list changes
shell: bash
run: echo "changes=$(git diff --name-only $GITHUB_REF origin/master | python ./bin/get_changes_from_git_diff.py https://preview.aclanthology.org/${{ steps.extract_branch.outputs.branch }})" >> $GITHUB_OUTPUT
id: list_changes
# - name: list volumes debug
# shell: bash
# run: |
# git diff --name-only $GITHUB_REF origin/master
# git diff --name-only $GITHUB_REF origin/master | python ./bin/volumes_from_diff.py https://preview.aclanthology.org/${{ steps.extract_branch.outputs.branch }}
- name: preview
shell: bash
env:
ANTHOLOGY_PREFIX: https://preview.aclanthology.org/${{ steps.extract_branch.outputs.branch }}
run: |
make NOBIB=true ANTHOLOGY_PREFIX=${ANTHOLOGY_PREFIX} check site preview
- uses: mshick/add-pr-comment@v2
with:
# this causes pushes to update the old message, instead of generating a new one
message-id: preview
message: |
Build successful. Some useful links:
* Complete site preview: https://preview.aclanthology.org/${{ steps.extract_branch.outputs.branch }}
* Potential changes of interest: ${{ steps.list_changes.outputs.changes }}
This preview will be removed when the branch is merged.
repo-token: ${{ secrets.GITHUB_TOKEN }}
allow-repeats: false