Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 32 additions & 11 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,30 +8,51 @@ on:
paths:
- 'website/**'

env:
GIT_CI_USER: ${{ vars.GIT_CI_USER || 'prestodb-ci' }}
GIT_CI_EMAIL: ${{ vars.GIT_CI_EMAIL || 'ci@lists.prestodb.io' }}

jobs:
checks:
if: github.event_name != 'push'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
- uses: actions/checkout@v6
with:
node-version: '18.x'
show-progress: false
persist-credentials: false
- uses: actions/setup-node@v4
- name: Test Build
run: cd website && yarn install && yarn build

gh-release:
if: github.event_name != 'pull_request'
runs-on: ubuntu-latest
environment: release
permissions:
contents: write
steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
- uses: actions/checkout@v6
with:
node-version: '18.x'
- name: Git config
run: git config --global user.email "presto-oss@users.noreply.github.com" && git config --global user.name "Presto Bot"
- name: Fetch credentials
run: echo "machine github.com login presto-oss password ${{ secrets.PRESTOOSS_PUBLISH_TOKEN }}" > ~/.netrc
token: ${{ secrets.PRESTODB_CI_TOKEN }}
show-progress: false
persist-credentials: true
- uses: actions/setup-node@v4
- name: Configure git
run: |
git config --global --add safe.directory ${{ github.workspace }}
git config --global user.email "$GIT_CI_EMAIL"
git config --global user.name "$GIT_CI_USER"
- name: Configure git credentials
env:
PRESTODB_CI_TOKEN: ${{ secrets.PRESTODB_CI_TOKEN }}
run: |
git config --global credential.helper store
printf 'https://%s:%s@github.com\n' "$GIT_CI_USER" "$PRESTODB_CI_TOKEN" > ~/.git-credentials
chmod 600 ~/.git-credentials
- name: Release to GitHub Pages
env:
GIT_USER: ${{ env.GIT_CI_USER }}
run: |
set -o pipefail
cd website && yarn install && GIT_USER="presto-oss" yarn run publish-gh-pages | (head -c 32768; echo "... skipping output ..."; tail -c 32768)
cd website && yarn install && yarn run publish-gh-pages | (head -c 32768; echo "... skipping output ..."; tail -c 32768)
Loading