Skip to content

Commit

Permalink
Add Tags for Docker Images (alshedivat#754)
Browse files Browse the repository at this point in the history
  • Loading branch information
pourmand1376 authored Jul 18, 2022
1 parent b6ea0d0 commit 99b14c4
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 4 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/deploy-docker-tag.yml
Original file line number Diff line number Diff line change
@@ -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 }}

6 changes: 2 additions & 4 deletions .github/workflows/deploy-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,14 @@ name: Docker Image CI
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:

build:

runs-on: ubuntu-latest
if: github.repository_owner == 'alshedivat'

steps:
- name: Checkout
uses: actions/checkout@v2
Expand All @@ -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:
Expand Down

0 comments on commit 99b14c4

Please sign in to comment.