Skip to content

PRを作成した際にビルドする #3

PRを作成した際にビルドする

PRを作成した際にビルドする #3

Workflow file for this run

name: Build and Push Multiple Docker Images
on:
pull_request:
types: [closed]
jobs:
build-and-push:
runs-on: ubuntu-latest
if: github.event.pull_request.merged == true
strategy:
matrix:
include:
- dockerfile: admin.k8s.Dockerfile
image_name: nutfes/group-manager-2-admin-view
- dockerfile: front.k8s.Dockerfile
image_name: nutfes/group-manager-2-user-front
- dockerfile: api.k8s.Dockerfile
image_name: nutfes/group-manager-2-api
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Log in to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_TOKEN }}
- name: Build and push Docker image
uses: docker/build-push-action@v2
with:
context: .
file: ${{ matrix.dockerfile }}
push: true
tags: ${{ matrix.image_name }}:latest