Skip to content

Commit 995cacb

Browse files
authored
Merge pull request pytorch#1415 from osalpekar/cci_to_gha
Moving Site Deployment script to GHA
2 parents 2149192 + 8de1c0c commit 995cacb

File tree

3 files changed

+42
-59
lines changed

3 files changed

+42
-59
lines changed

.circleci/config.yml

Lines changed: 0 additions & 57 deletions
This file was deleted.

.github/workflows/build.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Build
2+
3+
on:
4+
push:
5+
branches:
6+
- site
7+
workflow_dispatch:
8+
9+
jobs:
10+
tests:
11+
uses: pytorch/test-infra/.github/workflows/linux_job.yml@main
12+
with:
13+
runner: linux.12xlarge
14+
repository: pytorch/pytorch.github.io
15+
docker-image: cimg/ruby:2.7-node
16+
secrets-env: PYTORCHBOT_TOKEN
17+
script: |
18+
git config --global --add safe.directory /__w/pytorch.github.io/pytorch.github.io
19+
set -euxo pipefail
20+
21+
## Bundle Install
22+
cd
23+
mkdir .bundle
24+
bundle config path '~/vendor/bundle'
25+
git clone https://github.com/pytorch/pytorch.github.io.git
26+
cd pytorch.github.io
27+
bundle install
28+
29+
## Yarn Install
30+
yarn install --cache-folder ~/.cache/yarn
31+
32+
## Notedown Install
33+
sudo apt update && sudo apt install python3-pip && sudo -H pip3 install pyrsistent==0.16 notedown pyyaml -Iv nbformat==5.7
34+
35+
## Configure Bot
36+
git config --global user.email "facebook-circleci-bot@users.noreply.github.com"
37+
git config --global user.name "Website Deployment Script"
38+
39+
## Build Jekyll site and push to master
40+
./scripts/deploy-site.sh build

scripts/deploy-site.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
# Used with their MIT license https://github.com/eldarlabs/ghpages-deploy-script/blob/master/LICENSE
66

77
# abort the script if there is a non-zero error
8-
set -e
8+
set -ex
99

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

0 commit comments

Comments
 (0)