2023-03-30 12:54:45 +00:00
|
|
|
name: Dockerbuild
|
|
|
|
on:
|
|
|
|
workflow_dispatch: {}
|
|
|
|
push:
|
|
|
|
branches: [master, develop]
|
|
|
|
paths:
|
|
|
|
- "dockerbuild/**"
|
|
|
|
concurrency: ${{ github.workflow }}-${{ github.ref_name }}
|
|
|
|
env:
|
|
|
|
REGISTRY: ghcr.io
|
|
|
|
IMAGE_NAME: ${{ github.repository }}-dockerbuild
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
name: Docker Build
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
permissions:
|
|
|
|
contents: read
|
|
|
|
packages: write
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v3
|
|
|
|
|
|
|
|
- name: Log in to the Container registry
|
2023-08-28 09:04:59 +00:00
|
|
|
uses: docker/login-action@cf8514a65188af1d4f94f8c28a7a4153af1088ce
|
2023-03-30 12:54:45 +00:00
|
|
|
with:
|
|
|
|
registry: ${{ env.REGISTRY }}
|
|
|
|
username: ${{ github.actor }}
|
|
|
|
password: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
|
|
|
|
- name: Extract metadata for Docker
|
|
|
|
id: meta
|
2023-08-28 09:04:59 +00:00
|
|
|
uses: docker/metadata-action@0f8c876bafbf5dbce05c36682ec68e9a0274a48a
|
2023-03-30 12:54:45 +00:00
|
|
|
with:
|
|
|
|
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
|
|
|
|
tags: |
|
|
|
|
type=ref,event=branch
|
|
|
|
|
|
|
|
- name: Build and push Docker image
|
2023-08-28 09:04:59 +00:00
|
|
|
uses: docker/build-push-action@9311bf5263ae5b36f3ec67aff768790c6e2344ad
|
2023-03-30 12:54:45 +00:00
|
|
|
with:
|
|
|
|
context: dockerbuild
|
|
|
|
push: true
|
|
|
|
tags: ${{ steps.meta.outputs.tags }}
|
|
|
|
labels: ${{ steps.meta.outputs.labels }}
|