Skip to content

Bump docker/login-action from 2.1.0 to 2.2.0 #250

Bump docker/login-action from 2.1.0 to 2.2.0

Bump docker/login-action from 2.1.0 to 2.2.0 #250

---
name: 🐳 Docker Image CI
on: # yamllint disable-line rule:truthy
pull_request:
branches: [main]
tags: '*.*.*'
types: [closed]
jobs:
build_and_publish_on_docker_hub:
name: 🐳 Push Docker image to Docker Hub
if: github.event.pull_request.merged
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v3
- name: Prepare tags
id: prep
run: |
DOCKER_IMAGE=optnc/yamlfixer
VERSION=noop
if [[ $GITHUB_REF == refs/tags/* ]]; then
VERSION=${GITHUB_REF#refs/tags/}
TAGS="${DOCKER_IMAGE}:latest,${DOCKER_IMAGE}:stable,${DOCKER_IMAGE}:${VERSION}"
else
TAGS="${DOCKER_IMAGE}:latest"
fi
echo ::set-output name=tags::${TAGS}
- name: Login to DockerHub
uses: docker/[email protected]
with:
username: ${{secrets.OPT_DOCKERHUB_LOGIN}}
password: ${{secrets.OPT_DOCKERHUB_PASSWORD}}
- name: Build and push
id: docker_build
uses: docker/[email protected]
with:
context: .
file: ./Dockerfile
push: true
tags: ${{ steps.prep.outputs.tags }}