Skip to content

refactor: unit tests (#222) #44

refactor: unit tests (#222)

refactor: unit tests (#222) #44

name: Docker Dev Image CI
on:
push:
tags:
- '**-dev'
jobs:
api-build:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v3
- name: Docker meta
id: api-meta
uses: docker/metadata-action@v4
with:
images: line/abc-user-feedback-api
tags: |
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
- name: Login to DockerHub
if: github.event_name != 'pull_request'
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push API
uses: docker/build-push-action@v4
with:
context: .
file: ./docker/api.dockerfile
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.api-meta.outputs.tags }}
labels: ${{ steps.api-meta.outputs.labels }}
web-build:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v3
- name: Docker meta
id: web-meta
uses: docker/metadata-action@v4
with:
images: line/abc-user-feedback-web
tags: |
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
- name: Login to DockerHub
if: github.event_name != 'pull_request'
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push Web
uses: docker/build-push-action@v4
with:
context: .
file: ./docker/web.dockerfile
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.web-meta.outputs.tags }}
labels: ${{ steps.web-meta.outputs.labels }}