Skip to content

Moving Site Deployment script to GHA #1415

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 27 commits into from
Aug 10, 2023
Merged
Show file tree
Hide file tree
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
57 changes: 0 additions & 57 deletions .circleci/config.yml

This file was deleted.

40 changes: 40 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Build

on:
push:
branches:
- site
workflow_dispatch:

jobs:
tests:
uses: pytorch/test-infra/.github/workflows/linux_job.yml@main
with:
runner: linux.12xlarge
repository: pytorch/pytorch.github.io
docker-image: cimg/ruby:2.7-node
secrets-env: PYTORCHBOT_TOKEN
script: |
git config --global --add safe.directory /__w/pytorch.github.io/pytorch.github.io
set -euxo pipefail

## Bundle Install
cd
mkdir .bundle
bundle config path '~/vendor/bundle'
git clone https://github.com/pytorch/pytorch.github.io.git
cd pytorch.github.io
bundle install

## Yarn Install
yarn install --cache-folder ~/.cache/yarn

## Notedown Install
sudo apt update && sudo apt install python3-pip && sudo -H pip3 install pyrsistent==0.16 notedown pyyaml -Iv nbformat==5.7

## Configure Bot
git config --global user.email "[email protected]"
git config --global user.name "Website Deployment Script"

## Build Jekyll site and push to master
./scripts/deploy-site.sh build
4 changes: 2 additions & 2 deletions scripts/deploy-site.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# Used with their MIT license https://github.com/eldarlabs/ghpages-deploy-script/blob/master/LICENSE

# abort the script if there is a non-zero error
set -e
set -ex

# initialize hub submodule
git submodule deinit -f . && git submodule update --init --recursive
Expand Down Expand Up @@ -57,7 +57,7 @@ git add -A
# now commit, ignoring branch master doesn't seem to work, so trying skip
git commit --allow-empty -m "Deploy to GitHub Pages on master [ci skip]"
# and push, but send any output to /dev/null to hide anything sensitive
git push --force --quiet https://facebook-circleci-bot:$CIRCLECI_PUBLISH_TOKEN@github.com/pytorch/pytorch.github.io.git master
git push --force --quiet https://pytorchbot:$PYTORCHBOT_TOKEN@github.com/pytorch/pytorch.github.io.git master
# go back to where we started and remove the master git repo we made and used
# for deployment
cd ..
Expand Down