Skip to content

Commit

Permalink
Push container only when main pushed
Browse files Browse the repository at this point in the history
  • Loading branch information
doganulus committed Sep 27, 2024
1 parent 1b1ea82 commit a78cb47
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 2 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/labs344-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,5 @@ jobs:
with:
context: containers/labs344
platforms: ${{ matrix.platform }}
provenance: false
push: true
push: ${{ if github.event_name == 'push' && github.ref == 'refs/heads/main' }}
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest,${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.IMAGE_TAG }}
24 changes: 24 additions & 0 deletions .github/workflows/retention.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: ghcr-retention
on:
workflow_dispatch:
schedule:
- cron: "0 12 * * 0"

permissions:
contents: read
packages: write

jobs:
clean:
runs-on: ubuntu-latest
name: Github Container Registry Retention Policy
steps:
- name: Clean up untagged Autoware images
uses: snok/[email protected]
with:
account: bounverif
token: ${{ secrets.GITHUB_TOKEN }}
image-names: "labs344"
tag-selection: untagged
cut-off: 1h
dry-run: false

0 comments on commit a78cb47

Please sign in to comment.