Skip to content

Commit 17dc233

Browse files
committed
fix: github workflows
1 parent 7c781aa commit 17dc233

File tree

2 files changed

+15
-7
lines changed

2 files changed

+15
-7
lines changed

.github/workflows/build-and-deploy.yml

+8-4
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,19 @@ jobs:
2626
runs-on: ubuntu-latest
2727
steps:
2828
- name: Set GIT_BRANCH
29-
run: |
30-
echo "GIT_BRANCH=${GITHUB_REF##*/}" >> $GITHUB_ENV
29+
run: echo "GIT_BRANCH=${GITHUB_REF##*/}" >> $GITHUB_ENV
30+
- name: Print GIT_BRANCH
31+
run: echo $GIT_BRANCH
32+
- name: Print content
33+
run: ln -ls
3134
- name: Print branch if version
3235
if: ${{ inputs.branch == 'version' }}
3336
run: echo ${{ inputs.branch }}
3437
- name: Print branch if main
3538
if: ${{ inputs.branch == 'main' }}
3639
run: echo ${{ inputs.branch }}
37-
- uses: actions/checkout@v2
40+
# This should be set up from earlier
41+
# - uses: actions/checkout@v2
3842
- uses: actions/setup-node@v2
3943
with:
4044
node-version: 14
@@ -55,7 +59,7 @@ jobs:
5559
SAS: ${{ secrets.SAS }}
5660
- name: Rewrite docs paths if version branch
5761
if: ${{ inputs.branch == 'version' }}
58-
run: node scripts/build-as-doc-version.js ${GIT_BRANCH}
62+
run: node scripts/build-as-doc-version.js $(GIT_BRANCH)
5963
- name: Build site for locale
6064
run: yarn i18n:build ${{ inputs.locale }}
6165
env:

.github/workflows/update-docs-branch.yml

+7-3
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,17 @@ jobs:
2525
run: 'yarn process-docs-changes'
2626
env:
2727
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
28-
- name: branch
29-
run: echo "::set-output name=branch::`git branch --show-current`"
28+
- id: branch
29+
name: Calculate branch
30+
run: |
31+
[[ $(git branch --show-current) =~ ^v[0-9]+-x-y$ ]] && echo "::set-output name=branch::version" || echo "::set-output name=branch::other"
32+
- name: Show branch
33+
run: echo ${{ steps.branch.outputs.branch }}
3034
# GitHub will not kick the "push-XXX" workflow so we have to publish from here
3135
build-and-deploy:
3236
needs: [update-docs]
3337
# If we are in a version branch, it means we have pushed the changed directly and should deploy
34-
if: ${{ needs.branch.outputs.branch =~ ^v[0-9]+-x-y$ }}
38+
if: ${{ needs.update-docs.outputs.branch == 'version' }}
3539
uses: electron/electronjs.org-new/.github/workflows/build-and-deploy.yml@main
3640
with:
3741
locale: en

0 commit comments

Comments
 (0)