-
Notifications
You must be signed in to change notification settings - Fork 66
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #19 from Multiwoven/feat/server-actions
feat: move server and ui github action ci to root
- Loading branch information
Showing
12 changed files
with
153 additions
and
157 deletions.
There are no files selected for viewing
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
name: server-ci | ||
|
||
on: | ||
push: | ||
branches: [main] | ||
paths: | ||
- "server/**" | ||
pull_request: | ||
branches: [main] | ||
paths: | ||
- "server/**" | ||
|
||
env: | ||
DB_HOST: localhost | ||
DB_USERNAME: postgres | ||
DB_PASSWORD: postgres | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
|
||
services: | ||
postgres: | ||
image: postgres:13 | ||
env: | ||
POSTGRES_USER: postgres | ||
POSTGRES_PASSWORD: postgres | ||
POSTGRES_DB: multiwoven_test | ||
ports: | ||
- 5432:5432 | ||
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5 | ||
|
||
steps: | ||
- name: Checkout Code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Setup Ruby | ||
uses: ruby/setup-ruby@v1 | ||
with: | ||
ruby-version: 3.2.0 | ||
|
||
- name: Bundle Install | ||
run: bundle install | ||
working-directory: ./server | ||
|
||
- name: Database Setup | ||
run: bundle exec rake db:create db:schema:load --trace | ||
working-directory: ./server | ||
|
||
- name: Run RuboCop | ||
run: bundle exec rubocop | ||
working-directory: ./server | ||
|
||
- name: Run Tests | ||
run: bundle exec rspec | ||
working-directory: ./server |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
name: server-docker-build | ||
|
||
on: | ||
workflow_run: | ||
workflows: ["server-ci"] | ||
branches: [main] | ||
types: | ||
- completed | ||
|
||
env: | ||
IMAGE_NAME: multiwoven/multiwoven-server | ||
IMAGE_TAG: latest-main | ||
|
||
jobs: | ||
build_and_push: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout Code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Login to Docker Hub | ||
run: echo "${{ secrets.DOCKER_PASSWORD }}" | docker login --username ${{ secrets.DOCKER_USERNAME }} --password-stdin | ||
|
||
- name: Build and Push Docker image | ||
run: | | ||
docker build -t ${{ env.IMAGE_NAME }}:${{ env.IMAGE_TAG }} -t ${{ env.IMAGE_NAME }}:${{ github.sha }} -f server/Dockerfile ./server | ||
docker push ${{ env.IMAGE_NAME }}:${{ env.IMAGE_TAG }} | ||
docker push ${{ env.IMAGE_NAME }}:${{ github.sha }} |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
name: frontend-ci | ||
|
||
on: | ||
pull_request: | ||
paths: | ||
- "ui/**" | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Set up Node.js | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: "18" | ||
|
||
- name: Install dependencies | ||
run: npm install | ||
working-directory: ./ui | ||
|
||
- name: Run tests and collect coverage | ||
run: npm test -- --coverage | ||
working-directory: ./ui |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
name: frontend-docker-build | ||
|
||
on: | ||
workflow_run: | ||
workflows: ["frontend-ci"] | ||
branches: [main] | ||
types: | ||
- completed | ||
|
||
env: | ||
IMAGE_NAME: multiwoven/multiwoven-ui | ||
IMAGE_TAG: latest-main | ||
|
||
jobs: | ||
build_and_push: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout Code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Login to Docker Hub | ||
run: echo "${{ secrets.DOCKER_PASSWORD }}" | docker login --username ${{ secrets.DOCKER_USERNAME }} --password-stdin | ||
|
||
- name: Build and Push Docker image | ||
run: | | ||
docker build -t ${{ env.IMAGE_NAME }}:${{ env.IMAGE_TAG }} -t ${{ env.IMAGE_NAME }}:${{ github.sha }} -f ui/Dockerfile ./ui | ||
docker push ${{ env.IMAGE_NAME }}:${{ env.IMAGE_TAG }} | ||
docker push ${{ env.IMAGE_NAME }}:${{ github.sha }} |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.