Skip to content

Build and Push Docker Image #16

Build and Push Docker Image

Build and Push Docker Image #16

Workflow file for this run

name: Build and Push Docker Image
# Image Repository:
# https://hub.docker.com/repository/docker/kenso312/nestjs-v10-webpack-boilerplate
on:
workflow_run:
workflows:
- Merge to Main Branch
types:
- completed
jobs:
build-and-push-docker-image:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Setting Up QEMU
uses: docker/setup-qemu-action@v3
- name: Setting Up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ github.repository_owner }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Checkout Repository
uses: actions/checkout@v4
with:
fetch-depth: 0 # Required for github-action-get-previous-tag
- name: Get Latest Tag
id: get-tag
uses: WyriHaximus/github-action-get-previous-tag@v1
with:
fallback: v1.0.0
- name: Building and Pushing
uses: docker/build-push-action@v5
if: steps.get-tag.outputs.tag
with:
push: true
file: ./ci/Dockerfile
tags: |
${{ github.repository }}:${{ steps.get-tag.outputs.tag }}
${{ github.repository }}:latest