Minor improvement of GitHub CI
This commit is contained in:
parent
182f0cc890
commit
c49676b14f
@ -3,22 +3,32 @@ name: Docker image CI
|
|||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [ master ]
|
branches: [ master ]
|
||||||
|
paths-ignore:
|
||||||
|
- '**/README.md'
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
name: Build and push Docker image to Docker Hub and GitHub Containers Repository
|
name: Build and publish Docker image to Docker Hub and GitHub Containers Repository
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: Remove "_Docker" suffix from GitHub repository name to use it as image name
|
||||||
|
uses: mad9000/actions-find-and-replace-string@3
|
||||||
|
id: docker_image_name
|
||||||
|
with:
|
||||||
|
source: ${{ github.repository }}
|
||||||
|
find: '_Docker'
|
||||||
|
replace: ''
|
||||||
|
|
||||||
- name: Docker meta
|
- name: Docker meta
|
||||||
id: meta
|
id: meta
|
||||||
uses: docker/metadata-action@v4
|
uses: docker/metadata-action@v4
|
||||||
with:
|
with:
|
||||||
images: |
|
images: |
|
||||||
${{ github.repository }}
|
${{ steps.docker_image_name.outputs.value }}
|
||||||
ghcr.io/${{ github.repository }}
|
ghcr.io/${{ steps.docker_image_name.outputs.value }}
|
||||||
tags: type=raw,value=latest
|
tags: type=raw,value=latest
|
||||||
|
|
||||||
- name: Login to Docker Hub
|
- name: Login to Docker Hub
|
||||||
@ -37,7 +47,7 @@ jobs:
|
|||||||
- name: Set up Docker Buildx
|
- name: Set up Docker Buildx
|
||||||
uses: docker/setup-buildx-action@v2
|
uses: docker/setup-buildx-action@v2
|
||||||
|
|
||||||
- name: Build and push Docker image
|
- name: Build and publish Docker image
|
||||||
uses: docker/build-push-action@v4
|
uses: docker/build-push-action@v4
|
||||||
with:
|
with:
|
||||||
context: .
|
context: .
|
||||||
Loading…
Reference in New Issue
Block a user