Skip to content

v2.7.38

v2.7.38 #138

Workflow file for this run

---
name: Publish
on:
release:
types:
- published
workflow_dispatch:
inputs:
TAG_NAME:
description: 'Tag name that the major tag will point to'
required: true
env:
DOCKER_IMAGE_NAME: gofrolist/molecule
TAG_NAME: ${{ github.event.inputs.TAG_NAME || github.event.release.tag_name }}
permissions:
contents: write
jobs:
publish:
name: Publish Release
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v4.2.1
- name: Docker meta
id: meta
uses: docker/metadata-action@v5.5.1
with:
images: ${{ env.DOCKER_IMAGE_NAME }}
tags: |
type=semver,pattern=v{{version}}
type=semver,pattern=v{{major}}
type=ref,event=branch
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3.7.1
- name: Login to DockerHub
if: github.event_name == 'release'
uses: docker/login-action@v3.3.0
with:
username: ${{ github.actor }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Push Docker image
uses: docker/build-push-action@v6.9.0
with:
context: .
file: Dockerfile
push: ${{ github.event_name == 'release' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Update the ${{ env.TAG_NAME }} tag
id: update-major-tag
uses: actions/publish-action@v0.3.0
with:
source-tag: ${{ env.TAG_NAME }}
# slack-webhook: ${{ secrets.SLACK_WEBHOOK }}
# - name: Update major tag
# uses: Actions-R-Us/actions-tagger@latest
validate:
needs:
- publish
runs-on: ubuntu-22.04
steps:
- name: Test run Molecule from DockerHub latest image
uses: docker://gofrolist/molecule:latest
with:
molecule_options: --version