Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhance Docker CI to auto-push on release #435

Open
justb4 opened this issue Aug 11, 2022 · 0 comments
Open

Enhance Docker CI to auto-push on release #435

justb4 opened this issue Aug 11, 2022 · 0 comments

Comments

@justb4
Copy link
Member

justb4 commented Aug 11, 2022

Is your feature request related to a problem? Please describe.
We need a simpler and more modern Docker build/push GH Workflow

Describe the solution you'd like
See this article:
https://xy2z.io/posts/2022-github-actions-build-push-docker-image/
Plus need to add existing stuff from current docker.yml: no action on doc changes, run unit tests with Docker Image.

So basics:

name: Docker Build and Push

on:
  push:
    branches:
      - 'master'
  release:
    types: [published]

jobs:
  docker:
    runs-on: ubuntu-latest
    steps:
      -
        name: Checkout
        uses: actions/checkout@v2
      -
        name: Set up QEMU
        uses: docker/setup-qemu-action@v1
      -
        name: Set up Docker Buildx
        uses: docker/setup-buildx-action@v1
      -
        name: Login to DockerHub
        uses: docker/login-action@v1
        with:
          username: ${{ secrets.DOCKERHUB_USERNAME }}
          password: ${{ secrets.DOCKERHUB_TOKEN }}
      -
        # Push to master branch - push "latest" tag
        name: Build and Push (latest)
        if: github.event_name == 'push'
        uses: docker/build-push-action@v2
        with:
          context: .
          push: true
          tags: geopython/geohealthcheck:latest
      -
        # Push the new release
        name: Build and Push New Release
        if: github.event_name == 'release'
        uses: docker/build-push-action@v2
        with:
          context: .
          push: true
          tags:  geopython/geohealthcheck:${{ github.event.release.tag_name }}

Describe alternatives you've considered
NA

Additional context
NA

@justb4 justb4 added this to the Version 0.9.1 milestone Aug 11, 2022
@justb4 justb4 modified the milestones: Version 0.9.1, Version 0.9.2 Jun 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant