Skip to content

Added semver

Added semver #10

name: Website Monitor - Publish Docker Image
on:
push:
branches: [ "main" ]
jobs:
update-semver:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: haya14busa/action-update-semver@v1
id: version
with:
major_version_tag_only: false # (optional, default is "false")
push_to_registry:
name: Push Docker Image to Docker Hub
needs: [update-semver]
runs-on: ubuntu-latest
steps:
- name: Checkout the repo
uses: actions/checkout@v4
- name: Get Version
id: version
run: echo ::set-output name=version::${{ steps.update-semver.outputs.new_version }}
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
with:
images: ninjaasa/influxdb-getting-started-website-monitor
tags: |
type=raw,value=${{ github.run_id }}
type=raw,value=${{ steps.date.outputs.date }}
type=raw,value=latest
- name: Build and push Docker image
uses: docker/build-push-action@3b5e8027fcad23fda98b2e3ac259d8d67585f671
with:
context: ./webmonitor
file: ./webmonitor/Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}