Skip to content

Build and Push Docker Image #5

Build and Push Docker Image

Build and Push Docker Image #5

Workflow file for this run

name: Build and Push Docker Image
on:
push:
tags:
- "v*.*.*"
jobs:
build:
permissions:
contents: write
runs-on: ubuntu-latest
steps:
- name: Check out the code
uses: actions/checkout@v4
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Extract version from tag
id: extract_version
run: echo "version=${GITHUB_REF##refs/tags/v}" >> $GITHUB_ENV
- name: Build and push
uses: docker/build-push-action@v6
with:
push: true
tags: |
${{ secrets.DOCKER_USERNAME }}/npm-cert-syncer:latest
${{ secrets.DOCKER_USERNAME }}/npm-cert-syncer:${{ env.version }}
- name: Create GitHub Release
uses: softprops/action-gh-release@v2