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

Adding build deploy staging workflow #1

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open
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
110 changes: 110 additions & 0 deletions .github/workflows/build-deploy-staging.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
name: site-deploy-github-pages-staging

on:
push:
branches: "adding_build_deploy_staging_workflow"

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
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.workflow }}
cancel-in-progress: false

jobs:
build:
runs-on: ubuntu-latest
outputs:
environment-name: ${{ steps.prepare.outputs.environment-name }}
environment-url: ${{ steps.prepare.outputs.environment-url }}
steps:
- name: Setup prerequisites
run: |
sudo apt-get update
sudo apt-get install -y curl make libxml2-dev libxslt-dev openssl libcurl4-openssl-dev

- name: Prepare environment props
id: prepare
run: |
echo "environment-url=https://geolexica-staging.github.io" >> $GITHUB_OUTPUT
echo "environment-name=staging" >> $GITHUB_OUTPUT

- name: Checkout repository
uses: actions/checkout@v3

- name: Use Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 2.7
bundler-cache: true

- name: Checkout data
uses: actions/checkout@v3
with:
token: ${{ github.token }}
repository: geolexica/isotc211-glossary
path: isotc211-glossary
ref: refs/heads/generated_concepts_from_20231214_glossary_with_math
fetch-depth: 1

- name: Checkout breviter
uses: actions/checkout@v3
with:
token: ${{ github.token }}
repository: geolexica/breviter
path: breviter
ref: main
fetch-depth: 1
submodules: true

- name: Cache relaton
uses: actions/cache@v3
with:
path: relaton
key: ${{ runner.os }}-${{ hashFiles(join(inputs.concepts-path, '/**/*.yaml')) }}

- name: Setup Pages
id: pages
uses: actions/configure-pages@v3

- name: Use Node
uses: actions/setup-node@v3
with:
node-version: '12'
cache: 'npm'

- run: npm install

- name: Build staging_site
run: make _site

- name: Compress files
run: zip -9 -r site.zip _site

- uses: actions/upload-artifact@v3
if: steps.prepare.outputs.environment-name != 'skip'
with:
name: staging_site
path: site.zip

- name: Upload artifact
uses: actions/upload-pages-artifact@v2
with:
path: _site

deploy:
if: needs.build.outputs.environment-name != 'skip'
runs-on: ubuntu-latest
needs: build
environment:
name: ${{ needs.build.outputs.environment-name }}
url: ${{ needs.build.outputs.environment-url }}
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2
23 changes: 0 additions & 23 deletions .github/workflows/build.yml

This file was deleted.

2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
source "https://rubygems.org"

gem "geolexica-site", "~> 1.7.7"
gem "geolexica-site", git: "https://github.com/geolexica/geolexica-site.git", branch: "updated_to_use_jekyll_geolexica_with_glossarist"
1 change: 1 addition & 0 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ defaults:
geolexica:
concepts_glob: "../isotc211-glossary/geolexica/concept/*.yaml"
localized_concepts_path: "../isotc211-glossary/geolexica/localized-concept"
glossary_path: "../isotc211-glossary/geolexica"
format: "paneron"
math: true
term_languages:
Expand Down
2 changes: 2 additions & 0 deletions glossarist.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
extension_attributes:
- status
Loading