Skip to content

Commit

Permalink
HDDS-9926. Publish WIP website to staging branch (2/2) (#56)
Browse files Browse the repository at this point in the history
  • Loading branch information
errose28 authored Dec 15, 2023
1 parent b3d9062 commit 1ca9d00
Show file tree
Hide file tree
Showing 2 changed files with 65 additions and 1 deletion.
62 changes: 62 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# Build Ozone website v2 and commit it to a staging branch.
# This will be picked up by configurations in .asf.yml to publish it to a staging domain.
name: "auto-publish-website-v2"

on:
push:
branches:
# TODO update this to master when the new website is ready to be published.
- HDDS-9225-website-v2

jobs:
build:
runs-on: ubuntu-latest
steps:
# Check out the website source in the current working directory.
- name: "Checkout source branch ${{ github.ref_name }}"
uses: actions/checkout@v3
with:
path: 'src'
- name: "Build website"
working-directory: 'src'
# Website source is mounted as volume, so the build output ends up in ./src/build outside of the container.
run: |
docker compose run site pnpm run build
- name: "Checkout publish branch"
uses: actions/checkout@v3
with:
path: 'publish'
# TODO update this to asf-site when the website is ready to be published.
ref: 'asf-site-v2'
- name: "Commit changes"
working-directory: 'publish'
run: |
# Delete previous build from the branch, but preserve files with necessary metadata.
mv README.md .asf.yaml .git /tmp
rm -rf $(ls -A)
mv /tmp/README.md /tmp/.asf.yaml /tmp/.git .
# Commit new build to the branch.
cp -R ../src/build/. .
git config --global user.name 'Github Actions'
git config --global user.email '[email protected]'
git add .
git commit -a -m "[auto] Apply changes from $GITHUB_REF_NAME $GITHUB_SHA" || true
git push
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@

Welcome to the development branch of the new and improved Apache Ozone website. The new site is being built with [Docusaurus](https://docusaurus.io/). See the [Docusaurus docs](https://docusaurus.io/docs) for details on working with this framework.

## Relevant Links
You can preview the current state of the new website at https://ozone-site-v2.staged.apache.org.

## Context

- [HDDS-9225](https://issues.apache.org/jira/browse/HDDS-9225) is the parent Jira tracking current tasks required to get the new website ready for deployment.

Expand Down

0 comments on commit 1ca9d00

Please sign in to comment.