Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build the website in github actions #245

Merged
merged 1 commit into from
Sep 19, 2024
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
41 changes: 41 additions & 0 deletions .github/workflows/website.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Build FOSDEM site

on:
push:
branches:
- master
- gha
pull_request:
branches:
- master

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Copy test penta/pretalx export
run: |
mv sample/export .
- name: Ensure pdf_grid is set to false in config.yaml
run: |
sed -i '/^pdf_grid/d' config.yaml
echo "pdf_grid: false" >> config.yaml


- name: Run nanoc build in docker
uses: docker://ghcr.io/johanvdw/fosdem-website
with:
entrypoint: /bin/sh
args: -c "bundle install && nanoc"

# Step 5: Upload the 'output' directory as an artifact
- name: Upload output directory
uses: actions/upload-artifact@v4
with:
name: nanoc-output
path: output

8 changes: 3 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,17 @@ RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -yq \
krb5-user

# Copy the Gemfile in and bundle, so we have the dependencies cached
ADD Gemfile .
ADD Gemfile.lock .
COPY Gemfile Gemfile.lock .
RUN gem install bundler:1.17.3 && bundle install

# Set encoding to prevent nanoc exploding
ENV LANG=C.UTF-8
ENV APP_DIR=/usr/src/app

# Copy the rest of the app in
ADD . $APP_DIR

# Port 3000 is used for `nanoc view`
EXPOSE 3000
WORKDIR $APP_DIR
ENTRYPOINT ["bundle", "exec"]

LABEL org.opencontainers.image.source https://github.com/FOSDEM/website
CMD ['nanoc', 'view']