Update build-deploy-staging.yml #4
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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://isotc211.geolexica.org/staging" >> $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 |