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

Commit

Permalink
split ci actions
Browse files Browse the repository at this point in the history
  • Loading branch information
carlosthe19916 committed Sep 2, 2021
1 parent 17acb40 commit 74ae1d1
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 59 deletions.
65 changes: 6 additions & 59 deletions .github/workflows/ci-actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ name: CI
on:
push:
branches-ignore:
- 'dependabot/**'
- "dependabot/**"
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
paths-ignore:
- "README.md"

jobs:
unit-test:

runs-on: ubuntu-latest

strategy:
Expand All @@ -29,17 +29,6 @@ jobs:
with:
flags: unitests

# visual-test:
# runs-on: ubuntu-latest
# if: ${{ github.event_name != 'pull_request' && github.repository_owner == 'project-openubl' }}
# steps:
# - uses: actions/checkout@v1
# - run: yarn install
# - uses: chromaui/action@v1
# with:
# token: ${{ secrets.GITHUB_TOKEN }}
# projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}

e2e:
runs-on: ${{ matrix.os }}
strategy:
Expand All @@ -66,7 +55,7 @@ jobs:
env:
POSTGRES_USER: user
POSTGRES_PASSWORD: password
POSTGRES_DB: xsender_db
POSTGRES_DB: ublhub_db
options: >-
--health-cmd pg_isready
--health-interval 10s
Expand All @@ -79,7 +68,7 @@ jobs:
env:
QUARKUS_DATASOURCE_USERNAME: user
QUARKUS_DATASOURCE_PASSWORD: password
QUARKUS_DATASOURCE_JDBC_URL: jdbc:postgresql://backend-db:5432/xsender_db
QUARKUS_DATASOURCE_JDBC_URL: jdbc:postgresql://backend-db:5432/ublhub_db
QUARKUS_OIDC_AUTH_SERVER_URL: http://keycloak:8080/auth/realms/openubl
QUARKUS_OIDC_CLIENT_ID: xsender
QUARKUS_OIDC_CREDENTIALS_SECRET: secret
Expand Down Expand Up @@ -114,7 +103,7 @@ jobs:
record: ${{ env.CYPRESS_RECORD_KEY != null }}
tag: ${{ steps.define_tags.outputs.value }}
start: yarn run xsender:ui
wait-on: 'http://localhost:3000'
wait-on: "http://localhost:3000"
wait-on-timeout: 120
config: pageLoadTimeout=100000
browser: ${{ matrix.browser }}
Expand All @@ -134,45 +123,3 @@ jobs:
- uses: codecov/[email protected]
with:
flags: e2etests

container-images:
if: ${{ github.event_name != 'pull_request' && github.repository_owner == 'project-openubl' }}
runs-on: ubuntu-latest
needs: [unit-test, visual-test, e2e]
steps:
- uses: actions/checkout@v2
- name: Use Node.js
uses: actions/[email protected]
with:
node-version: 12.x
- run: yarn install
- run: yarn build
- name: Push to GitHub Packages
uses: elgohr/Publish-Docker-Github-Action@master
with:
registry: docker.pkg.github.com
name: project-openubl/ublhub-ui/ublhub-ui
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
dockerfile: Dockerfile
snapshot: false
tags: "master"
- name: Push to Docker Hub
uses: elgohr/Publish-Docker-Github-Action@master
with:
name: projectopenubl/ublhub-ui
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
dockerfile: Dockerfile
snapshot: false
tags: "master"
- name: Push to Quay.io
uses: elgohr/Publish-Docker-Github-Action@master
with:
registry: quay.io
name: projectopenubl/ublhub-ui
username: ${{ secrets.QUAYIO_USERNAME }}
password: ${{ secrets.QUAYIO_PASSWORD }}
dockerfile: Dockerfile
snapshot: false
tags: "master"
54 changes: 54 additions & 0 deletions .github/workflows/container-images.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Container images generator

on:
push:
branches-ignore:
- "dependabot/**"

jobs:
container-images:
if: ${{ github.repository_owner == 'project-openubl' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Use Node.js
uses: actions/[email protected]
with:
node-version: 12.x
- name: Build
run: |
yarn install
yarn build
- name: Extract branch name
shell: bash
run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})"
id: extract_branch
- name: Push to GitHub Packages
uses: elgohr/Publish-Docker-Github-Action@master
with:
registry: docker.pkg.github.com
name: project-openubl/ublhub-ui/ublhub-ui
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
dockerfile: Dockerfile
snapshot: false
tags: ${{ steps.extract_branch.outputs.branch }}
- name: Push to Docker Hub
uses: elgohr/Publish-Docker-Github-Action@master
with:
name: projectopenubl/ublhub-ui
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
dockerfile: Dockerfile
snapshot: false
tags: ${{ steps.extract_branch.outputs.branch }}
- name: Push to Quay.io
uses: elgohr/Publish-Docker-Github-Action@master
with:
registry: quay.io
name: projectopenubl/ublhub-ui
username: ${{ secrets.QUAYIO_USERNAME }}
password: ${{ secrets.QUAYIO_PASSWORD }}
dockerfile: Dockerfile
snapshot: false
tags: ${{ steps.extract_branch.outputs.branch }}

0 comments on commit 74ae1d1

Please sign in to comment.