Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

release - 29 sep #11

Merged
merged 2 commits into from
Sep 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@ jobs:

- name: Build project
env:
REACT_APP_CHATBOT_API_URL: ${{ env.CHATBOT_API_URL }}
REACT_APP_CHATBOT_API_URL: ${{ vars.REACT_APP_CHATBOT_API_URL }}
run: npm run build
46 changes: 43 additions & 3 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,38 @@ on:
push:
branches:
- main
paths-ignore:
- "chore(release):*"

jobs:
upload-build:
name: Build & Upload
check-commit-message:
name: Check Commit Message
runs-on: ubuntu-latest
outputs:
should_run: ${{ steps.check_commit.outputs.should_run }}

steps:
- name: Checkout repo
uses: actions/checkout@v3

- name: Get commit message
id: commit_message
run: echo "::set-output name=message::$(git log -1 --pretty=%B)"

- name: Determine if workflow should run
id: check_commit
run: |
if [[ "${{ steps.commit_message.outputs.message }}" == *"chore(release):"* ]]; then
echo "::set-output name=should_run::false"
else
echo "::set-output name=should_run::true"
fi

release:
name: Release
runs-on: ubuntu-latest
needs: check-commit-message
if: needs.check-commit-message.outputs.should_run == 'true'

steps:
- name: Checkout repo
Expand All @@ -22,6 +49,19 @@ jobs:
- name: Install dependencies
run: npm ci

- name: Set Git user
run: |
git config user.email "github-actions@github.com"
git config user.name "GitHub Action Bot"

- name: Create release
run: npm run release

- name: Push changes and tags
run: git push --follow-tags origin main
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Build project
env:
REACT_APP_CHATBOT_API_URL: ${{ vars.REACT_APP_CHATBOT_API_URL }}
Expand All @@ -35,7 +75,7 @@ jobs:

deploy:
name: Deploy
needs: upload-build
needs: [release, check-commit-message]
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main'

Expand Down
Loading
Loading