Skip to content

Work infinispan 1132 #1532

Work infinispan 1132

Work infinispan 1132 #1532

Workflow file for this run

name: pull-request
on: pull_request_target
jobs:
deploy:
name: Deploy localized site preview to surge.sh
runs-on: ubuntu-22.04
steps:
- name: Checkout base branch
# To avoid GitHub Secrets compromise, checkout base branch to get reliable (untainted) build scripts
uses: actions/checkout@v3
- name: Checkout merged commit to 'merged' dir
# Checkout merged commit to 'merged' dir
uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}
path: merged
- name: Copy l10n dir
# Copy the merged commit's l10n dir to base branch code base for build
run: |
rm -rf l10n
cp -r merged/l10n ./
- name: Cache bundle directory
# Cache ruby bundle directory to speed up build
uses: actions/cache@v3
with:
path: vendor/bundle
key: ${{ runner.os }}-gem-${{ hashFiles('**/Gemfile.lock') }}
- name: Setup build env
# Setup build environment(install runtime, library, etc.)
run: |
bin/setup-build-env-on-ubuntu
- name: Restore mtime
run: |
cd upstream
git restore-mtime
- name: Build for preview
# Build for preview to build a localized site (only latest guides are built)
run: vendor/quarkus-l10n-utils/bin/build-for-preview
# ref. https://github.com/quarkusio/quarkusio.github.io/blob/f935cd0d21acff6e7de9b7c8b6f86622f1104251/.github/workflows/build.yml#L73-L78
- name: Reduce the size of the website to be compatible with surge
run: |
cd upstream
find assets/images/posts/ -mindepth 1 -maxdepth 1 -type d -mtime +100 -exec rm -rf ../docs/{} \;
find newsletter/ -mindepth 1 -maxdepth 1 -type d -mtime +100 -exec rm -rf ../docs/{} \;
rm -rf ../docs/assets/images/worldtour/2023
rm -rf ../docs/assets/images/desktopwallpapers
- name: Deploy to surge
# Deploy the site to surge.sh
# We use surge.sh for pull-request preview because surge.sh supports custom sub-domain and it fits pull-request preview site.
run: |
surge docs pr-preview-${{ github.event.pull_request.number }}-ja-quarkusio.surge.sh
env:
SURGE_LOGIN: ${{ secrets.SURGE_LOGIN }}
SURGE_TOKEN: ${{ secrets.SURGE_TOKEN }}
- name: Add comment
# Add comment to the pull request to announce the deployed preview site URL.
uses: actions/github-script@v3.1.0
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
let body = `Site preview(ja): https://pr-preview-${{ github.event.pull_request.number }}-ja-quarkusio.surge.sh`
github.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: body
})