Skip to content

Publish Jepsen Images #104

Publish Jepsen Images

Publish Jepsen Images #104

name: Publish Jepsen Images
on:
workflow_dispatch:
env:
GH_TOKEN: ${{ github.token }}
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
jobs:
publish-jepsen-images:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: checkout jepsen-docker
uses: actions/checkout@v4
- name: Build Jepsen Images
run: |
cd $GITHUB_WORKSPACE
docker build -t jepsen-setup ./jepsen-setup
docker build -t jepsen-node ./jepsen-node
docker build -t jepsen-control ./jepsen-control
- name: List Docker Images
run: |
echo Built docker images:
docker images
- name: Login to Container Registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Tag Images
run: |
docker tag jepsen-setup ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}/jepsen-setup
docker tag jepsen-node ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}/jepsen-node
docker tag jepsen-control ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}/jepsen-control
echo Tagged docker images:
docker images
- name: Push Images
run: |
docker push -q ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}/jepsen-setup
docker push -q ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}/jepsen-node
docker push -q ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}/jepsen-control
- name: Delete Old jepsen-setup Images
uses: actions/delete-package-versions@v5
with:
package-name: 'jepsen-docker/jepsen-setup'
package-type: 'container'
delete-only-untagged-versions: 'true'
- name: Delete Old jepsen-node Images
uses: actions/delete-package-versions@v5
with:
package-name: 'jepsen-docker/jepsen-node'
package-type: 'container'
delete-only-untagged-versions: 'true'
- name: Delete Old jepsen-control Images
uses: actions/delete-package-versions@v5
with:
package-name: 'jepsen-docker/jepsen-control'
package-type: 'container'
delete-only-untagged-versions: 'true'