Merge pull request #113 from line/dev #6
Workflow file for this run
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
name: Docker Prod Image CI | |
on: | |
push: | |
tags: | |
- '*' | |
- '!**-beta' | |
- '!**-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 }} |