Skip to content
This repository has been archived by the owner on Aug 6, 2024. It is now read-only.

Commit

Permalink
chore(cicd): support building of test images, add image cleanup action (
Browse files Browse the repository at this point in the history
  • Loading branch information
rmoesbergen authored Dec 3, 2023
1 parent d729951 commit c62e934
Showing 1 changed file with 22 additions and 2 deletions.
24 changes: 22 additions & 2 deletions .github/workflows/docker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ on:
push:
tags:
- v*
branches:
- main
workflow_dispatch: {}

jobs:
Expand All @@ -20,10 +22,28 @@ jobs:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push Docker image
- name: Build and push PROD Docker image
if: github.ref_type == 'tag'
uses: docker/[email protected]
with:
file: Dockerfile
context: .
push: true
tags: ghcr.io/leaphy-robotics/leaphy-webbased/leaphy-webbased:latest
tags: ghcr.io/leaphy-robotics/leaphy-webbased/leaphy-webbased:prod

- name: Build and push TEST Docker image
if: github.ref_type == 'branch'
uses: docker/[email protected]
with:
file: Dockerfile
context: .
push: true
tags: ghcr.io/leaphy-robotics/leaphy-webbased/leaphy-webbased:main

- name: Clean up old images
uses: actions/delete-package-versions@v4
with:
package-name: 'leaphy-webbased'
package-type: 'container'
min-versions-to-keep: 5
delete-only-untagged-versions: 'true'

0 comments on commit c62e934

Please sign in to comment.