Update README.md #15
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: Docker Image | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- main | |
- develop | |
tags: | |
- 'v*' | |
pull_request: | |
types: [opened, synchronize, reopened] | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
env: | |
DOCKER_IMAGE_NAME: socheatsok78/dockerswarm_sd_server | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v2 | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Generate GitHub metadata | |
id: github-meta | |
uses: dockerbakery/github-metadata-action@v2 | |
- name: Login to Docker Registry | |
uses: docker/login-action@v2 | |
with: | |
username: ${{ vars.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN}} | |
- name: Docker meta | |
id: meta | |
uses: docker/metadata-action@v5 | |
with: | |
images: ${{ env.DOCKER_IMAGE_NAME }} | |
tags: | | |
type=ref,event=branch | |
type=semver,pattern={{version}} | |
type=semver,pattern={{major}}.{{minor}} | |
- name: Build and push | |
uses: docker/bake-action@v2 | |
with: | |
targets: default | |
push: ${{ github.event_name != 'pull_request' }} | |
pull: true | |
files: | | |
./docker-bake.hcl | |
${{ steps.meta.outputs.bake-file }} | |
${{ steps.github-meta.outputs.bake-file }} | |
- name: Docker Metadata Summary | |
uses: dockerbakery/docker-metadata-summary@v1 |