Skip to content

Commit

Permalink
Add basic gh image build
Browse files Browse the repository at this point in the history
  • Loading branch information
ccorsin committed Aug 1, 2023
1 parent 3445dde commit 3558f97
Showing 1 changed file with 51 additions and 0 deletions.
51 changes: 51 additions & 0 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Install

env:
REGISTRY: ghcr.io
REGISTRY_IMAGE: ghcr.io/cosmian/anonymization_ui

on:
push:
tags:
- "*"

jobs:
build:
runs-on: self-hosted
permissions:
packages: write
contents: read
steps:
- uses: actions/checkout@v3

- name: Login to GitHub Packages
uses: docker/login-action@v2
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Docker ui metadata
id: meta-back
uses: docker/metadata-action@v4
with:
images: |
${{ env.REGISTRY_IMAGE }}
tags: |
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Build UI docker image
if: startsWith(github.ref, 'refs/tags')
uses: docker/build-push-action@v3
with:
context: "{{defaultContext}}"
push: true
tags: |
${{ env.REGISTRY_IMAGE }}
labels: ${{ steps.meta-back.outputs.labels }}

0 comments on commit 3558f97

Please sign in to comment.