From 68d57b1c8ef658ed0c5b13314192daf1241b9a38 Mon Sep 17 00:00:00 2001 From: Cyber MacGeddon Date: Fri, 4 Oct 2024 17:35:52 +0100 Subject: [PATCH] Container push to Docker hub --- .github/workflows/release.yaml | 44 ++++++++++++++++++---------------- 1 file changed, 23 insertions(+), 21 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index aa76d370..ff3ee4f3 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -6,8 +6,8 @@ on: push: # branches: # - release/v0.12 - tags: - - v0.12.* +# tags: +# - v0.12.* permissions: contents: read @@ -39,30 +39,12 @@ jobs: - name: Build packages run: make packages -# - name: Build container -# run: make container - # - name: Publish release distributions to PyPI # uses: pypa/gh-action-pypi-publish@release/v1 - name: Create deploy bundle run: templates/generate-all deploy.zip v${{ steps.version.outputs.VERSION }} - # - name: Create Release - # id: create_release - # uses: actions/create-release@v1 - # env: - # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token - # with: - # tag_name: ${{ github.ref }} - # release_name: Release ${{ github.ref }} - # body: | - # Changes in this Release - # - First Change - # - Second Change - # draft: true - # prerelease: true - - uses: ncipollo/release-action@v1 with: artifacts: deploy.zip @@ -71,14 +53,34 @@ jobs: prerelease: true skipIfReleaseExists: true + - name: Log in to Docker Hub + uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_SECRET }} + + - name: Build container + run: make container + - name: Extract metadata for container id: meta uses: docker/metadata-action@v4 with: - images: trustgraph-flow + images: trustgraph/trustgraph-flow tags: | type=ref,event=branch type=ref,event=pr type=semver,pattern={{version}} type=semver,pattern={{major}}.{{minor}} type=sha + + - name: Build and push Docker image + id: push + uses: docker/build-push-action@3b5e8027fcad23fda98b2e3ac259d8d67585f671 + with: + context: . + file: ./Containerfile + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} +