Merge pull request #157 from wdhdev/renovate/all-minor-patch #151
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Docker | |
on: | |
push: | |
branches: [main] | |
workflow_dispatch: | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
env: | |
DOCKER_IMAGE_NAME: ${{ secrets.DOCKER_USERNAME }}/${{ github.event.repository.name }} | |
DOCKER_REGISTRY: docker.io | |
GITHUB_IMAGE_NAME: ${{ github.repository }} | |
GITHUB_REGISTRY: ghcr.io | |
jobs: | |
build-and-deploy: | |
name: Build and Deploy | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Login to ${{ env.DOCKER_REGISTRY }} | |
uses: docker/login-action@v3 | |
with: | |
registry: ${{ env.DOCKER_REGISTRY }} | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_PASSWORD }} | |
- name: Login to ${{ env.GITHUB_REGISTRY }} | |
uses: docker/login-action@v3 | |
with: | |
registry: ${{ env.GITHUB_REGISTRY }} | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build and Push Image | |
uses: docker/build-push-action@v6 | |
with: | |
context: . | |
push: true | |
tags: | | |
${{ env.DOCKER_IMAGE_NAME }}:latest | |
${{ env.DOCKER_IMAGE_NAME }}:${{ github.ref_name }} | |
${{ env.GITHUB_REGISTRY }}/${{ env.GITHUB_IMAGE_NAME }} | |
${{ env.GITHUB_REGISTRY }}/${{ env.GITHUB_IMAGE_NAME }}:${{ github.ref_name }} |