Skip to content
This repository has been archived by the owner on Apr 25, 2023. It is now read-only.

Commit

Permalink
ci: fix build workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
rot1024 committed Jun 14, 2022
1 parent 67da5c6 commit 1c2fcf1
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
12 changes: 5 additions & 7 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ jobs:
if: github.event.workflow_run.conclusion == 'success' && github.event.repository.full_name == 'reearth/reearth-web'
outputs:
tag: ${{ steps.info.outputs.tag }}
branch: ${{ steps.info.outputs.branch }}
name: ${{ steps.info.outputs.name }}
steps:
- uses: actions/checkout@v3
Expand All @@ -24,14 +23,14 @@ jobs:
run: git fetch --prune --unshallow --tags
- name: Get info
id: info
env:
BRANCH: ${{ github.event.workflow_run.head_branch }}
# The tag name should be retrieved lazily, as tagging may be delayed.
run: |
TAG=$(git tag --points-at HEAD)
if [[ ! -z "$TAG" ]]; then
echo "::set-output name=tag::$TAG"
fi
BRANCH=$(git branch --show-current)
echo "::set-output name=branch::$BRANCH"
if [[ "$BRANCH" = "release" ]]; then
echo "::set-output name=name::rc"
else
Expand All @@ -40,15 +39,14 @@ jobs:
- name: Show info
env:
tag: ${{ steps.info.outputs.tag }}
BRANCH: ${{ steps.info.outputs.branch }}
NAME: ${{ steps.info.outputs.name }}
run: echo "tag=$tag, branch=$BRANCH, name=$NAME"
run: echo "tag=$tag, name=$NAME"
build:
name: Build
runs-on: ubuntu-latest
needs:
- info
if: needs.info.outputs.branch == 'main' || needs.info.outputs.branch == 'release'
if: github.event.workflow_run.head_branch == 'main' || github.event.workflow_run.head_branch == 'release'
steps:
- uses: actions/setup-node@v3
with:
Expand Down Expand Up @@ -107,7 +105,7 @@ jobs:
runs-on: ubuntu-latest
needs:
- info
if: needs.info.outputs.branch == 'release' && needs.info.outputs.tag
if: github.event.workflow_run.head_branch == 'release' && needs.info.outputs.tag
env:
ARTIFACT: reearth-web_${{ needs.info.outputs.tag }}.tar.gz
steps:
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/deploy_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ jobs:
runs-on: ubuntu-latest
if: github.event.workflow_run.conclusion == 'success' && github.event.repository.full_name == 'reearth/reearth-web'
steps:
- name: Print head branch
run: echo $BRANCH
env:
BRANCH: ${{ github.event.workflow_run.head_branch }}
- uses: google-github-actions/setup-gcloud@v0
with:
project_id: ${{ secrets.GCP_PROJECT }}
Expand Down

0 comments on commit 1c2fcf1

Please sign in to comment.