From 3c54907dd63243fd80f8902ece4be446a9ef78e6 Mon Sep 17 00:00:00 2001 From: Jonathan Ho Date: Tue, 28 Feb 2023 13:28:17 -0800 Subject: [PATCH 1/3] ci: update website build process (#2808) * ci: update website build process * ci: also trigger on ci file change * ci: fix id used two times * ci: fix missing work dir --- .github/workflows/site.yml | 34 ++++++++++++++++++++++++++-------- 1 file changed, 26 insertions(+), 8 deletions(-) diff --git a/.github/workflows/site.yml b/.github/workflows/site.yml index 5e7410675..fe915515d 100644 --- a/.github/workflows/site.yml +++ b/.github/workflows/site.yml @@ -8,11 +8,13 @@ on: push: branches: ["main"] paths: - - "site/**" + - "website/**" + - ".github/workflows/site.yml" pull_request: branches: ["main"] paths: - - "site/**" + - "website/**" + - ".github/workflows/site.yml" # Allows you to run this workflow manually from the Actions tab workflow_dispatch: @@ -29,9 +31,6 @@ jobs: # The type of runner that the job will run on name: Build Docusaurus runs-on: ubuntu-latest - defaults: - run: - working-directory: ./website # Steps represent a sequence of tasks that will be executed as part of the job steps: # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it @@ -39,23 +38,42 @@ jobs: - uses: actions/setup-node@v3 with: node-version: 18 + - name: Get yarn cache directory path (root) + id: yarn-cache-dir-path-root + run: echo "dir=$(yarn config get cacheFolder)" >> $GITHUB_OUTPUT + - uses: actions/cache@v3 + with: + path: ${{ steps.yarn-cache-dir-path-root.outputs.dir }} + key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} + restore-keys: | + ${{ runner.os }}-yarn- + - name: yarn install (root) + run: yarn install --immutable + - name: Build all pkg + run: yarn release-build + - name: Build docs + run: yarn build:doc + - name: Get yarn cache directory path id: yarn-cache-dir-path run: echo "dir=$(yarn config get cacheFolder)" >> $GITHUB_OUTPUT + working-directory: ./website - uses: actions/cache@v3 with: path: ${{ steps.yarn-cache-dir-path.outputs.dir }} key: ${{ runner.os }}-yarn-site-${{ hashFiles('**/yarn.lock') }} restore-keys: | ${{ runner.os }}-yarn-site- + - run: yarn install --immutable + working-directory: ./website - name: Build website - run: | - yarn - yarn build + run: yarn build + working-directory: ./website - name: Upload artifact uses: actions/upload-pages-artifact@v1 with: path: ./website/build + deploy: environment: name: github-pages From 349df7b4cedf1a6208236824796ef7f840e5c8bf Mon Sep 17 00:00:00 2001 From: Skillz4Killz <23035000+Skillz4Killz@users.noreply.github.com> Date: Tue, 28 Feb 2023 16:52:39 -0600 Subject: [PATCH 2/3] Create sync_repos.yml --- .github/workflows/sync_repos.yml | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 .github/workflows/sync_repos.yml diff --git a/.github/workflows/sync_repos.yml b/.github/workflows/sync_repos.yml new file mode 100644 index 000000000..60860953b --- /dev/null +++ b/.github/workflows/sync_repos.yml @@ -0,0 +1,24 @@ +name: Sync Repos + +on: + push: + branches: + - main + paths: + - "website/**" + # - "template/**" + +jobs: + sync: + runs-on: ubuntu-latest + steps: + - name: Checkout Repository + uses: actions/checkout@master + - name: Run GitHub File Sync + uses: BetaHuhn/repo-file-sync-action@v1 + with: + GH_PAT: ${{ secrets.REPO_SYNC }} + GIT_EMAIL: to@itoh.at + GIT_USERNAME: itohatweb + SKIP_PR: true + COMMIT_EACH_FILE: false From 3ebcce8d564cb393553f6c2047ca1cb78e16b015 Mon Sep 17 00:00:00 2001 From: Skillz4Killz <23035000+Skillz4Killz@users.noreply.github.com> Date: Tue, 28 Feb 2023 16:53:07 -0600 Subject: [PATCH 3/3] Update sync.yml --- .github/sync.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/sync.yml b/.github/sync.yml index a8ce90747..a50205c5a 100644 --- a/.github/sync.yml +++ b/.github/sync.yml @@ -1,5 +1,5 @@ discordeno/guide: - - source: site/ + - source: website/ dest: ./ exclude: | README.md