Skip to content

Commit

Permalink
feat: publish Docker image on GitHub
Browse files Browse the repository at this point in the history
  • Loading branch information
andresrosenthal committed Feb 6, 2025
1 parent ab0ddfc commit 930930a
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/publish_image.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Publish example-restapi image
on:
push:
branches:
- main
env:
REGISTRY: ghcr.io
XROAD_HOME: ${{ github.workspace }}
jobs:
Publish:
name: Publish example-restapi image
runs-on: ubuntu-22.04
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v4
- name: Log in to the Container registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push Docker image
uses: docker/build-push-action@v6
with:
context: ${{ github.workspace }}
push: true
tags: ghcr.io/nordic-institute/xrddev-example-restapi:latest
- name: Clean old images
uses: snok/container-retention-policy@v2
with:
image-names: xrddev-example-restapi
cut-off: 1 week ago UTC
timestamp-to-use: created_at
account-type: org
org-name: nordic-institute
keep-at-least: 1
token-type: github-token
token: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit 930930a

Please sign in to comment.