Skip to content

Merge pull request #51 from edenartlab/stage #122

Merge pull request #51 from edenartlab/stage

Merge pull request #51 from edenartlab/stage #122

Workflow file for this run

name: 'Build and Deploy - Logos Service'
on:
workflow_dispatch:
push:
branches: [main]
pull_request:
branches: [main]
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
ENV_STAGE: prod
jobs:
build-and-push-to-ghcr:
name: Build
runs-on: ubuntu-20.04
permissions:
contents: read
packages: write
outputs:
tag: ${{ steps.prep.outputs.tag }}
steps:
- uses: actions/checkout@v2
- id: prep
run: |
TAG=$(echo $GITHUB_SHA | head -c7)
IMAGE="${{ env.REGISTRY }}/edenartlab/logos-svc"
echo ::set-output name=tagged_image::${IMAGE}:${TAG}
echo ::set-output name=tag::${TAG}
echo ::set-output name=image::${IMAGE}
- name: Log in to GHCR
if: github.event_name != 'pull_request'
uses: docker/login-action@v1
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and Push
uses: docker/build-push-action@v2
with:
context: .
file: ./Dockerfile
push: true
tags:
${{ steps.prep.outputs.tagged_image }},${{ steps.prep.outputs.image
}}:latest