Container Image CI debian12 #288
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
# ********************************************************************************************************************** # | |
# # | |
# ::: ::: ::: ::: ::: ::: ::::::::::: :::::::::: # | |
# containerdisk-debian12.yml :+: :+: :+: :+: :+: :+: :+: :+: :+: # | |
# +:+ +:+ +:+ +:+ +:+ +:+ +:+ +:+ +:+ # | |
# By: codespace <codespace@kalyte.ro> +#++:++ +#++:++#++: +#+ +#++: +#+ +#++:++# # | |
# +#+ +#+ +#+ +#+ +#+ +#+ +#+ +#+ # | |
# Created: 2023/12/17 16:36:26 by codespace #+# #+# #+# #+# #+# #+# #+# #+# # | |
# Updated: 2023/12/17 16:37:32 by codespace ### ### ### ### ########## ### ### ##########.ro # | |
# # | |
# ********************************************************************************************************************** # | |
name: Container Image CI debian12 | |
on: | |
push: | |
branches: [ "main" ] | |
pull_request: | |
branches: [ "main" ] | |
release: | |
types: [published] | |
schedule: | |
- cron: "0 0 * * *" | |
env: | |
REGISTRY: ghcr.io | |
IMAGE_NAME: ${{ github.repository }} | |
jobs: | |
build-and-push-image: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
packages: write | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Login to Github Container Registory | |
uses: docker/login-action@v2 | |
with: | |
registry: ${{ env.REGISTRY }} | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Extract metadata (tags, labels) for Container | |
id: meta | |
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7 | |
with: | |
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | |
- name: Build and Push Container Images | |
uses: docker/build-push-action@v4 | |
with: | |
context: . | |
file: ./debian12.Dockerfile | |
push: true | |
tags: ghcr.io/docheio/containerdisk-debian:12 | |
labels: ${{ steps.meta.outputs.labels }} | |
- name: Log in to Docker Hub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Tag and push to Docker Hub | |
run: | | |
docker pull ghcr.io/docheio/containerdisk-debian:12 | |
docker tag ghcr.io/docheio/containerdisk-debian:12 \ | |
docker.io/${{ secrets.DOCKERHUB_USERNAME }}/containerdisk-debian:12 | |
docker push docker.io/${{ secrets.DOCKERHUB_USERNAME }}/containerdisk-debian:12 | |
- name: Log in to KubevirtJP | |
uses: docker/login-action@v3 | |
with: | |
registry: cr.kubevirt.jp | |
username: ${{ secrets.KUBEVIRT_USERNAME }} | |
password: ${{ secrets.KUBEVIRT_TOKEN }} | |
- name: Tag and push to KubevirtJP | |
run: | | |
docker pull ghcr.io/docheio/containerdisk-debian:12 | |
docker tag ghcr.io/docheio/containerdisk-debian:12 \ | |
cr.kubevirt.jp/debian:12 | |
docker push cr.kubevirt.jp/debian:12 |