Skip to content

Merge pull request #2192 from nordic-institute/dependabot/github_acti… #8

Merge pull request #2192 from nordic-institute/dependabot/github_acti…

Merge pull request #2192 from nordic-institute/dependabot/github_acti… #8

name: Publish test CA image
on:
push:
branches:
- develop
paths:
- '.github/workflows/publish_testca.yaml'
- 'Docker/testca/**'
- 'ansible/roles/xroad-ca/**'
env:
REGISTRY: ghcr.io
XROAD_HOME: ${{ github.workspace }}
jobs:
PublishCS:
name: Publish test CA image
runs-on: ubuntu-22.04
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v4
- name: Initialize docker setup
working-directory: ./Docker/testca
run: ./init_context.sh
- 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 }}/Docker/testca
push: true
tags: ghcr.io/nordic-institute/xrddev-testca:latest
- name: Clean old CA images
uses: snok/container-retention-policy@v2
with:
image-names: xrddev-testca
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 }}