price service publisher #12
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
# Build the docker image and push it to GitHub Packages | |
name: price service publisher | |
on: | |
workflow_dispatch: | |
branches: | |
- dev | |
- master | |
env: | |
REGISTRY: ghcr.io | |
IMAGE_NAME: coti-io/price-service | |
jobs: | |
build: | |
name: Build and push price-service image | |
runs-on: ubuntu-latest | |
permissions: | |
packages: write | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Extract metadata (tags, labels) for Docker | |
id: meta | |
uses: docker/metadata-action@v4 | |
with: | |
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | |
tags: | | |
type=sha | |
type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', 'master') }} | |
type=raw,value=latest-{{branch}} | |
- name: Log in to the Container registry | |
uses: docker/login-action@v2 | |
with: | |
registry: ${{ env.REGISTRY }} | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build and push price-service to GitHub Packages | |
uses: docker/build-push-action@v3 | |
with: | |
push: true | |
tags: ${{ steps.meta.outputs.tags }} |