Skip to content

Deploy static content to Pages #590

Deploy static content to Pages

Deploy static content to Pages #590

Workflow file for this run

# Simple workflow for deploying static content to GitHub Pages
name: Deploy static content to Pages
on:
push:
branches:
- main
schedule:
- cron: "0 0 * * *"
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
env:
DEPARTMENTS: "disi dei"
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write
# Allow one concurrent deployment
concurrency:
group: "pages"
cancel-in-progress: true
jobs:
generate:
name: Generate source
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: "1.20"
cache: true
- run: go get .
- run: go build raccoglitesi.go
- run: ./raccoglitesi ${{ env.DEPARTMENTS }}
- name: Generate build artifact
uses: actions/upload-artifact@v4
with:
name: site-source
path: site
build:
name: Asciidoc to HTML
runs-on: ubuntu-latest
needs: generate
steps:
- uses: ruby/setup-ruby@v1
with:
ruby-version: '3.0'
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
- run: gem install asciidoctor asciidoctor-pdf
- name: Download site
uses: actions/download-artifact@v4
with:
name: site-source
path: site
- name: Compile asciidoc files to HTML
run: asciidoctor "site/*.adoc"
- name: Compile asciidoc files to PDF
run: asciidoctor-pdf "site/*.adoc"
- name: Generate build artifact
uses: actions/upload-artifact@v4
with:
name: site
path: site
deploy:
name: Deploy to GitHub Pages
environment:
name: github-pages
url: https://csunibo.github.io/raccoglitesi/disi.pdf
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/checkout@v4
- name: Download site
uses: actions/download-artifact@v4
with:
name: site
path: site
- name: Setup Pages
uses: actions/configure-pages@v5
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: site
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4