Skip to content

Create and publish a Docker image #13

Create and publish a Docker image

Create and publish a Docker image #13

Workflow file for this run

name: Create and publish a Docker image
on:
release:
types: [published]
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
jobs:
build-and-push-image:
runs-on: ubuntu-latest
permissions:
contents: write
packages: write
attestations: write
id-token: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Log in to the Container registry
uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Controller
id: push
uses: docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4
with:
file: ${{ github.workspace }}/Dockerfile.controller
context: .
target: controller
push: true
tags: |
${{ env.REGISTRY }}/${{github.repository}}:latest
${{ env.REGISTRY }}/${{github.repository}}:${{github.event.release.tag_name}}
- name: "Providers: AWS"
id: aws
uses: docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4
with:
file: ${{ github.workspace }}/Dockerfile.providers
context: .
target: aws
push: true
tags: |
${{ env.REGISTRY }}/pier-oliviert/providers-aws:latest
${{ env.REGISTRY }}/pier-oliviert/providers-aws:${{github.event.release.tag_name}}
- name: "Providers: Azure"
id: azure
uses: docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4
with:
file: ${{ github.workspace }}/Dockerfile.providers
context: .
target: azure
push: true
tags: |
${{ env.REGISTRY }}/pier-oliviert/providers-azure:latest
${{ env.REGISTRY }}/pier-oliviert/providers-azure:${{github.event.release.tag_name}}
- name: "Providers: Cloudflare"
id: cloudflare
uses: docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4
with:
file: ${{ github.workspace }}/Dockerfile.providers
context: .
target: cloudflare
push: true
tags: |
${{ env.REGISTRY }}/pier-oliviert/providers-cloudflare:latest
${{ env.REGISTRY }}/pier-oliviert/providers-cloudflare:${{github.event.release.tag_name}}
- name: "Providers: deSEC"
id: desec
uses: docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4
with:
file: ${{ github.workspace }}/Dockerfile.providers
context: .
target: desec
push: true
tags: |
${{ env.REGISTRY }}/pier-oliviert/providers-desec:latest
${{ env.REGISTRY }}/pier-oliviert/providers-desec:${{github.event.release.tag_name}}