Skip to content

Modernize deployment #1969

Modernize deployment

Modernize deployment #1969

Workflow file for this run

name: Deployment
on:
push:
pull_request:
schedule:
- cron: '0 4 * * *'
workflow_dispatch:
defaults:
run:
shell: bash
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- name: Get Date
id: get-date
run: |
echo "date=$(/bin/date -u "+%Y%m%d")" >> $GITHUB_OUTPUT
- name: Cache ccache
uses: actions/cache@v4
with:
path: |
~/.ccache
key: ${{ runner.os }}-ccache-${{ steps.get-date.outputs.date }}
restore-keys: |
${{ runner.os }}-ccache-
- name: Cache pip
uses: actions/cache@v4
with:
path: |
~/.cache/pip
key: ${{ runner.os }}-pip-${{ steps.get-date.outputs.date }}
restore-keys: |
${{ runner.os }}-pip-
- name: Install
run: |
GITHUB_REF=${GITHUB_REF#refs/heads/}
GITHUB_REF=${GITHUB_REF#refs/tags/}
BRANCH=${GITHUB_BASE_REF:-${GITHUB_REF}}
mkdir -p ${HOME}/.ssh
ssh-keyscan -t rsa -H "github.com" 2>&1 | tee -a "${HOME}"/.ssh/known_hosts
.ci/install.bash --branch=${BRANCH} --gh-token="${{ github.token }}" --sl=ed --sl=geolib2 --sl=rgbd # (In)direct deps of ed_object_models, but we don't need to build it
- name: Script
run: .ci/script.bash
- name: Before Deploy
run: .ci/pre_deploy.bash
- name: Upload static files as artifact
id: deployment
uses: actions/upload-pages-artifact@v4
with:
path: docs/
deploy:
name: Deployment
needs: build
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
permissions:
actions: read # To read the artifact from the previous job
id-token: write
pages: write
if: ${{ (github.event_name == 'schedule' || github.event_name == 'push' || github.event_name == 'workflow_dispatch') && github.ref == 'refs/heads/master' }}
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4