Skip to content

Tag Docker Image with Git #6

Tag Docker Image with Git

Tag Docker Image with Git #6

Workflow file for this run

name: Tag Docker Image with Git
on:
push:
tags:
- '*'
pull_request:
branches: [ "main" ]
env:
REGISTRY: ghcr.io
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Log into the Container registry
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata for the server image
id: servermeta
uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
with:
images: ${{ env.REGISTRY }}/suda/dvsync-server
- name: Extract metadata for the client image
id: clientmeta
uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
with:
images: ${{ env.REGISTRY }}/suda/dvsync-client
- name: Build and push the server image
uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc
with:
file: Dockerfile.server
push: true
tags: ${{ steps.servermeta.outputs.tags }}
labels: ${{ steps.servermeta.outputs.labels }}
- name: Build and push the client image
uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc
with:
file: Dockerfile.client
push: true
tags: ${{ steps.clientmeta.outputs.tags }}
labels: ${{ steps.clientmeta.outputs.labels }}