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-06-22 13:43:45 +00:00
|
|
|
uses: docker/login-action@465a07811f14bebb1938fbed4728c6a1ff8901fc
|
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-05-09 05:53:36 +00:00
|
|
|
uses: docker/metadata-action@c4ee3adeed93b1fa6a762f209fb01608c1a22f1e
|
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-06-27 11:27:16 +00:00
|
|
|
uses: docker/build-push-action@2eb1c1961a95fc15694676618e422e8ba1d63825
|
2023-03-30 12:54:45 +00:00
|
|
|
with:
|
|
|
|
context: dockerbuild
|
|
|
|
push: true
|
|
|
|
tags: ${{ steps.meta.outputs.tags }}
|
|
|
|
labels: ${{ steps.meta.outputs.labels }}
|