From 8a902dce19536c266632ee9f4ce433f2648c48e7 Mon Sep 17 00:00:00 2001 From: itstimetoforget Date: Wed, 22 May 2024 20:48:00 +0200 Subject: [PATCH] add github-workflow --- .../workflows/build_and_push_docker_image.yml | 43 +++++++++++++++++++ .../build_and_push_docker_image/Dockerfile | 1 + 2 files changed, 44 insertions(+) create mode 100644 .github/workflows/build_and_push_docker_image.yml create mode 100644 actionfiles/build_and_push_docker_image/Dockerfile diff --git a/.github/workflows/build_and_push_docker_image.yml b/.github/workflows/build_and_push_docker_image.yml new file mode 100644 index 0000000..21eb0b3 --- /dev/null +++ b/.github/workflows/build_and_push_docker_image.yml @@ -0,0 +1,43 @@ +name: "Build and Push Docker-Image" + +on: + push: +# branches: +# - master +# tags: +# - "*" + +env: + REGISTRY: ghcr.io + IMAGE_NAME: ${{ github.repository }} + + +jobs: + build: + name: Build and Push + runs-on: ubuntu-latest + permissions: + packages: write + steps: + - name: checkout + uses: actions/checkout@v4 + - name: Log into GH container registry + uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Extract metadata (tags, labels) for Docker + id: meta + uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7 + with: + images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + - name: Build and push Docker image + id: push + uses: docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4 + with: + context: . + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ github.event.release.tag_name }} + file: actionfiles/build_and_push_docker_image/Dockerfile diff --git a/actionfiles/build_and_push_docker_image/Dockerfile b/actionfiles/build_and_push_docker_image/Dockerfile new file mode 100644 index 0000000..c24d5ef --- /dev/null +++ b/actionfiles/build_and_push_docker_image/Dockerfile @@ -0,0 +1 @@ +FROM \ No newline at end of file