Skip to content

Update Publishing to surge step #6

Update Publishing to surge step

Update Publishing to surge step #6

Workflow file for this run

name: Publish website
on:
schedule:
- cron: '0 */6 * * *'
push:
branches: [ main ]
workflow_dispatch:
pull_request:
types: [ opened, synchronize, reopened ]
defaults:
run:
shell: bash
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 17
cache: "maven"
- name: Build with Maven
run: mvn -B formatter:validate impsort:check verify --file pom.xml -DskipTests
- name: Store PR id
run: |
mkdir pr
echo ${{ github.event.number }} > ./pr/pr-id.txt
- name: Upload PR id as artifact
uses: actions/upload-artifact@v4
with:
name: pr-id
path: pr
retention-days: 1
- name: Upload site as artifact
uses: actions/upload-artifact@v4
with:
name: site
path: docs/target/generated-docs
retention-days: 1
deploy:
# Only try and deploy on merged code
if: "github.repository == 'quarkiverse/quarkus-roq' && github.ref_name == 'main' && (github.event_name == 'push' || github.event_name == 'schedule' || github.event_name == 'workflow_dispatch')"
needs: [ build ]
permissions:
pages: write # to deploy to Pages
id-token: write # to verify the deployment originates from an appropriate source
runs-on: ubuntu-latest
# Deploy to the github-pages environment
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- uses: actions/checkout@v4 # not needed for the code, but needed for the git config
- name: Download Built site
uses: actions/download-artifact@v4
with:
name: site
path: _site
- name: Setup Pages
uses: actions/configure-pages@v5
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4