Skip to content

#243 Doc create tutorial.adoc.po #225

#243 Doc create tutorial.adoc.po

#243 Doc create tutorial.adoc.po #225

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: 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
- 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 }}"-pt-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/[email protected]
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
let body = `Site preview(pt): https://pr-preview-${{ github.event.pull_request.number }}-pt-quarkusio.surge.sh`
github.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: body
})