Skip to content

Move CI to GitHub Actions #17

Move CI to GitHub Actions

Move CI to GitHub Actions #17

Workflow file for this run

# Copyright 2015-2020 The Khronos Group Inc.
# SPDX-License-Identifier: Apache-2.0
name: KTX-Specification Build CI
on:
# Trigger the workflow on a pull request,
pull_request:
push:
# And on pushes to main, which will occur when a PR is merged.
branches:
- main
# Also trigger on push of release tags to any branch. Useful
# for testing release builds before merging to main.
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'
- 'v[0-9]+.[0-9]+.[0-9]+-*'
paths-ignore:
- .appveyor.yml
- .travis.yml
# Allow manual trigger
workflow_dispatch:
jobs:
build-specs:
name: Build KTX File Format and KTX Fragment URI specifications
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Asciidoctor
run: sudo apt-get install -y asciidoctor
- name: Build specs
run: make ghpages
- name: Upload generated files for GitHub Pages
id: deployment
uses: actions/upload-pages-artifact@v3
with:
path: out/ghpages/
generate-switches:
name: Generate and test compile format conversion switches.
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Generate switches
run: make switches
- name: Test compile switches
run: make testswitches
deploy:
name: Deploy to GitHub Pages
# Add a dependency to the build job
needs: build-specs
# Only deploy when building `main`.
if: github.ref == 'refs/heads/main'
# Grant GITHUB_TOKEN the permissions required to make a Pages deployment
permissions:
pages: write # to deploy to Pages
id-token: write # to verify the deployment originates from an appropriate source
# Deploy to the github-pages environment
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
# Specify runner + deployment step
runs-on: ubuntu-latest
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4