Merge pull request #2457 from nordic-institute/XRDDEV-2691 #14
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }} |