mirror of
https://github.com/edgelesssys/constellation.git
synced 2024-12-11 17:04:22 -05:00
55 lines
1.5 KiB
Plaintext
55 lines
1.5 KiB
Plaintext
|
name: Build and Upload {{ micro-service }} image
|
||
|
env:
|
||
|
REGISTRY: ghcr.io
|
||
|
IMAGE_NAME: {{ micro-service }}
|
||
|
|
||
|
on:
|
||
|
workflow_dispatch:
|
||
|
push:
|
||
|
branches:
|
||
|
- main
|
||
|
paths:
|
||
|
- "{{ micro-service }}/**"
|
||
|
- "internal/{{ micro-service-dependency-1 }}/**"
|
||
|
- "internal/{{ micro-service-dependency-2 }}/**"
|
||
|
|
||
|
jobs:
|
||
|
build:
|
||
|
runs-on: ubuntu-latest
|
||
|
permissions:
|
||
|
contents: read
|
||
|
packages: write
|
||
|
steps:
|
||
|
- uses: actions/checkout@v1
|
||
|
|
||
|
- name: Docker meta
|
||
|
id: meta
|
||
|
uses: docker/metadata-action@v3
|
||
|
with:
|
||
|
images: |
|
||
|
${{ env.REGISTRY }}/${{ github.repository }}/${{ env.IMAGE_NAME }}
|
||
|
tags: |
|
||
|
type=raw,value=latest,enable={{is_default_branch}}
|
||
|
type=ref,event=branch
|
||
|
- name: Set up Docker Buildx
|
||
|
id: docker-setup
|
||
|
uses: docker/setup-buildx-action@v1
|
||
|
|
||
|
- name: Log in to the Container registry
|
||
|
id: docker-login
|
||
|
uses: docker/login-action@v1
|
||
|
with:
|
||
|
registry: ${{ env.REGISTRY }}
|
||
|
username: ${{ github.actor }}
|
||
|
password: ${{ secrets.GITHUB_TOKEN }}
|
||
|
|
||
|
- name: Build and push constellation-{{ micro-service }} container image
|
||
|
id: build-constellation-{{ micro-service }}
|
||
|
uses: docker/build-push-action@v2
|
||
|
with:
|
||
|
context: .
|
||
|
file: {{ micro-service }}/Dockerfile
|
||
|
target: release
|
||
|
push: true
|
||
|
tags: ${{ steps.meta.outputs.tags }}
|