Add Tags for Docker Images (#754)

This commit is contained in:
Amir Pourmand 2022-07-18 05:02:44 +04:30 committed by GitHub
parent b6ea0d01ff
commit 99b14c436f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 42 additions and 4 deletions

40
.github/workflows/deploy-docker-tag.yml vendored Normal file
View File

@ -0,0 +1,40 @@
name: Docker Image CI (Upload Tag)
on:
push:
tags:
- 'v*'
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Buildx
uses: docker/setup-buildx-action@v1
-
name: Docker meta
id: meta
uses: docker/metadata-action@v4
with:
images: amirpourmand/al-folio
- name: Login
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build and push
uses: docker/build-push-action@v3
with:
context: .
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

View File

@ -3,8 +3,6 @@ name: Docker Image CI
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
@ -12,7 +10,7 @@ jobs:
runs-on: ubuntu-latest
if: github.repository_owner == 'alshedivat'
steps:
- name: Checkout
uses: actions/checkout@v2
@ -24,7 +22,7 @@ jobs:
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build and push
uses: docker/build-push-action@v2
with: