Skip to content

Commit 60f6525

Browse files
committed
feat: add auto pages branch
1 parent 216ce85 commit 60f6525

1 file changed

Lines changed: 25 additions & 13 deletions

File tree

.github/workflows/build.yml

Lines changed: 25 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,6 @@ jobs:
9999
cd vscode
100100
npm run gulp compile-build-without-mangling # out-build
101101
npm run gulp vscode-web-ci # out-vscode-web .build/web/extensions
102-
cd ..
103102
104103
- name: Copy build
105104
run: |
@@ -121,34 +120,47 @@ jobs:
121120
122121
cd vscode-web-build && npm version "${{ needs.check_update.outputs.latest_tag }}" --no-git-tag-version
123122
124-
- name: Setup Pages
125-
uses: actions/configure-pages@v4
123+
# - name: Setup Pages
124+
# uses: actions/configure-pages@v4
126125

127-
- name: Upload artifact
128-
uses: actions/upload-pages-artifact@v3
129-
with:
130-
path: "./vscode-web-build"
126+
# - name: Upload artifact
127+
# uses: actions/upload-pages-artifact@v3
128+
# with:
129+
# path: "./vscode-web-build"
131130

132-
- name: Deploy to GitHub Pages
133-
id: deployment
134-
uses: actions/deploy-pages@v4
131+
# - name: Deploy to GitHub Pages
132+
# id: deployment
133+
# uses: actions/deploy-pages@v4
135134

136135
- name: Commit and push version bump
136+
env:
137+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
137138
run: |
138-
git config user.name "github-actions[bot]"
139-
git config user.email "github-actions[bot]@users.noreply.github.com"
139+
git config --global init.defaultBranch main
140+
git config --global user.name "github-actions[bot]"
141+
git config --global user.email "github-actions[bot]@users.noreply.github.com"
140142
git add -A
141143
# git commit --allow-empty --author="github-actions[bot] <github-actions[bot]@users.noreply.github.com>"
142144
git commit -m "chore: bump version to ${{ needs.check_update.outputs.latest_tag }}"
143145
git push origin HEAD:${GITHUB_REF_NAME}
144146
147+
origin="https://x-access-token:${GITHUB_TOKEN}@github.com/${{ github.repository }}.git"
148+
tmp_dir=$(mktemp -d -t vscode-web-build-XXX)
149+
cp -R vscode-web-build/* $tmp_dir
150+
cd $tmp_dir
151+
git init
152+
git branch -M pages
153+
git remote add origin $origin
154+
git add -A
155+
git commit --allow-empty-message -m "${{ needs.check_update.outputs.latest_tag }}"
156+
git push -f origin pages
157+
145158
- name: Package build
146159
run: |
147160
ls -ahlF vscode-web-build
148161
cd vscode-web-build
149162
cat package.json
150163
npm pack
151-
cd ..
152164
153165
- name: Release on GitHub
154166
uses: softprops/action-gh-release@v1

0 commit comments

Comments
 (0)