diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..94ad013 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,35 @@ +name: Publish Docker image + +on: + release: + types: [published] + +jobs: + push_to_registry: + name: Push Docker image to Docker Hub + runs-on: ubuntu-latest + steps: + - name: Check out the repo + uses: actions/checkout@v2 + + - name: Extract metadata (tags, labels) for Docker + id: meta + # https://github.com/docker/metadata-action + uses: docker/metadata-action@v3 + with: + images: crccheck/hello-world + + - name: Log in to DockerHub + uses: docker/login-action@v1 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Build and push + # https://github.com/docker/build-push-action + uses: docker/build-push-action@v2 + with: + context: . + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} diff --git a/README.md b/README.md index d806ca7..ebb8589 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,4 @@ -Hello World -=========== +# Hello World This is a simple Docker image that just gives http responses on port 8000. It's small enough to fit on one floppy disk: @@ -18,9 +17,7 @@ fresh environment in under a second. I like faster feedback loops. **THANK YOU** to the surprisingly large number of contributors that have made this better for everyone over the years. - -Sample Usage ------------- +## Sample Usage ### Starting a web server on port 80