Commit fa438c01 authored by ChakshuGautam's avatar ChakshuGautam
Browse files

ci(docker push): add docker tags based on release tags meta

Showing with 23 additions and 7 deletions
+23 -7
......@@ -3,14 +3,13 @@ name: Docker Push
on:
push:
tags:
- "v*.*.*"
- 'v*.*.*'
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Check Out Repo
- name: Check Out Repo
uses: actions/checkout@v2
- name: Login to Docker Hub
......@@ -18,18 +17,35 @@ jobs:
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
- name: Get Docker meta
id: meta
uses: docker/metadata-action@v3
with:
# list of Docker images to use as base name for tags
images: |
${{ secrets.DOCKER_HUB_USERNAME }}/esamwad-user-service
# generate Docker tags based on the following events/attributes
tags: |
type=schedule
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
type=sha
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v1
- name: Build and push
id: docker_build
uses: docker/build-push-action@v2
with:
context: .
push: true
tags: ${{ secrets.DOCKER_HUB_USERNAME }}/esamwad-user-service:latest
tags: ${{ steps.meta.outputs.tags }}
- name: Image digest
run: echo ${{ steps.docker_build.outputs.digest }}
\ No newline at end of file
run: echo ${{ steps.docker_build.outputs.digest }}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment