Skip to content

deploy-staging

deploy-staging #17

name: deploy-staging
on:
workflow_dispatch:
repository_dispatch:
types:
- deploy
# 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://isotc211.geolexica.org/isotc211-staging" >> $GITHUB_OUTPUT
echo "environment-name=staging" >> $GITHUB_OUTPUT
- name: Checkout repository
uses: actions/checkout@v3
with:
token: ${{ github.token }}
repository: geolexica/isotc211.geolexica.org
path: .
ref: refs/heads/add_config_for_glossarist
fetch-depth: 1
- name: Use Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 2.7
bundler-cache: false
- 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 data
make bundle
JEKYLL_ENV=staging NODE_ENV=staging bundle exec jekyll build --config _config_staging.yml
- name: Compress files
run: zip -9 -r site.zip _site
- uses: actions/upload-artifact@v3
with:
name: _site
path: site.zip
- name: Upload artifact
uses: actions/upload-pages-artifact@v2
with:
path: _site
deploy:
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