Publish Docker Image #4
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Publish Docker Image | |
on: | |
workflow_dispatch: | |
jobs: | |
build-and-push: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
# Add support for more platforms with QEMU (optional) | |
# https://github.com/docker/setup-qemu-action | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Login to DockerHub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{secrets.DOCKERHUB_USERNAME}} | |
password: ${{secrets.DOCKERHUB_TOKEN}} | |
- name: Retrieve the release version | |
id: npm-version | |
uses: martinbeentjes/npm-get-version-action@v1.3.1 | |
- name: Build and push Docker image | |
uses: docker/build-push-action@v3 | |
with: | |
context: ./docker | |
push: true | |
tags: ${{secrets.DOCKER_USERNAME}}/shevchenko:latest,${{secrets.DOCKER_USERNAME}}/shevchenko:${{steps.npm-version.outputs.current-version}} |