Skip to content

Release v0.1.5

Release v0.1.5 #13

Workflow file for this run

name: Build and Push Docker Image
on:
push:
tags:
- "v*" # Trigger only on version tags like v1.0.0
jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Log in to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
with:
install: true
- name: Create Buildx Builder
run: |
docker buildx create --name mybuilder --use
docker buildx inspect --bootstrap
- name: Extract Version Components
id: version
run: |
VERSION=${GITHUB_REF#refs/tags/v}
echo "VERSION=${VERSION}" >> $GITHUB_ENV
echo "MAJOR=${VERSION%%.*}" >> $GITHUB_ENV
echo "MINOR=${VERSION%.*}" >> $GITHUB_ENV
- name: Build and Push Docker Image with Multiple Tags and Architectures
uses: docker/build-push-action@v4
with:
context: .
push: true
platforms: linux/amd64,linux/arm64 # Specify both amd64 and arm64
tags: |
jonathanschad/react-nestjs-boilerplate:${{ env.VERSION }}
jonathanschad/react-nestjs-boilerplate:${{ env.MAJOR }}
jonathanschad/react-nestjs-boilerplate:${{ env.MINOR }}
jonathanschad/react-nestjs-boilerplate:latest