From 4c28ea0f96e8cf7bebb49635f564d52186660d3b Mon Sep 17 00:00:00 2001 From: mroxso Date: Tue, 15 Aug 2023 21:55:38 +0200 Subject: [PATCH] comment out ci for docker build action and improved docker build action --- .github/workflows/docker-image.yml | 33 ++++++++++++++++++++++++------ 1 file changed, 27 insertions(+), 6 deletions(-) diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index 259b4cf..808f1d0 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -1,18 +1,23 @@ name: Docker Build and Push on: + workflow_dispatch: push: branches: - main - master +env: + REGISTRY_NAME: ghcr.io + IMAGE_NAME: nostr-rs-relay + jobs: - ci: - name: CI - uses: ./.github/workflows/ci.yml + # ci: + # name: CI + # uses: ./.github/workflows/ci.yml build_and_push: - needs: [ci] + # needs: [ci] name: Build and Push runs-on: ubuntu-latest steps: @@ -32,13 +37,29 @@ jobs: username: ${{ github.repository_owner }} password: ${{ secrets.GITHUB_TOKEN }} - - name: Build and push + - name: Collecting Metadata + id: meta + uses: docker/metadata-action@v4 + with: + images: ${{ env.REGISTRY_NAME }}/${{ github.repository_owner }}/${{ env.IMAGE_NAME }} + + - name: Building And Pushing Image id: docker_build uses: docker/build-push-action@v4 with: context: . + file: ./Dockerfile push: true - tags: ghcr.io/${{ github.repository_owner }}/nostr-rs-relay:latest + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + + # - name: Build and push + # id: docker_build + # uses: docker/build-push-action@v4 + # with: + # context: . + # push: true + # tags: ghcr.io/${{ github.repository_owner }}/nostr-rs-relay:latest - name: Image digest run: echo ${{ steps.docker_build.outputs.digest }} \ No newline at end of file