Skip to content

Commit

Permalink
fix: github workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
molant committed Nov 9, 2021
1 parent 7c781aa commit 17dc233
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 7 deletions.
12 changes: 8 additions & 4 deletions .github/workflows/build-and-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,19 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Set GIT_BRANCH
run: |
echo "GIT_BRANCH=${GITHUB_REF##*/}" >> $GITHUB_ENV
run: echo "GIT_BRANCH=${GITHUB_REF##*/}" >> $GITHUB_ENV
- name: Print GIT_BRANCH
run: echo $GIT_BRANCH
- name: Print content
run: ln -ls
- name: Print branch if version
if: ${{ inputs.branch == 'version' }}
run: echo ${{ inputs.branch }}
- name: Print branch if main
if: ${{ inputs.branch == 'main' }}
run: echo ${{ inputs.branch }}
- uses: actions/checkout@v2
# This should be set up from earlier
# - uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: 14
Expand All @@ -55,7 +59,7 @@ jobs:
SAS: ${{ secrets.SAS }}
- name: Rewrite docs paths if version branch
if: ${{ inputs.branch == 'version' }}
run: node scripts/build-as-doc-version.js ${GIT_BRANCH}
run: node scripts/build-as-doc-version.js $(GIT_BRANCH)
- name: Build site for locale
run: yarn i18n:build ${{ inputs.locale }}
env:
Expand Down
10 changes: 7 additions & 3 deletions .github/workflows/update-docs-branch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,17 @@ jobs:
run: 'yarn process-docs-changes'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: branch
run: echo "::set-output name=branch::`git branch --show-current`"
- id: branch
name: Calculate branch
run: |
[[ $(git branch --show-current) =~ ^v[0-9]+-x-y$ ]] && echo "::set-output name=branch::version" || echo "::set-output name=branch::other"
- name: Show branch
run: echo ${{ steps.branch.outputs.branch }}
# GitHub will not kick the "push-XXX" workflow so we have to publish from here
build-and-deploy:
needs: [update-docs]
# If we are in a version branch, it means we have pushed the changed directly and should deploy
if: ${{ needs.branch.outputs.branch =~ ^v[0-9]+-x-y$ }}
if: ${{ needs.update-docs.outputs.branch == 'version' }}
uses: electron/electronjs.org-new/.github/workflows/build-and-deploy.yml@main
with:
locale: en
Expand Down

0 comments on commit 17dc233

Please sign in to comment.