Skip to content

Commit

Permalink
using ghcr.io
Browse files Browse the repository at this point in the history
  • Loading branch information
gjmzj committed Jun 23, 2024
1 parent 90c6c6f commit f18c68d
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 24 deletions.
Original file line number Diff line number Diff line change
@@ -1,48 +1,52 @@
name: build
name: Create and publish a Docker image

on:
push:
branches: ['main']

env:
REGISTRY: ghcr.io

jobs:
docker:
build-and-push-image:
runs-on: ubuntu-latest
# Sets the permissions granted to the `GITHUB_TOKEN` for the actions in this job.
permissions:
contents: read
packages: write
attestations: write
id-token: write
strategy:
fail-fast: false
matrix:
include:
- version: 3.6.4
# - version: 3.5.3
# - version: 3.4.6
# - version: 3.3.5
permissions:
contents: read
packages: write
steps:
-
name: Checkout
- name: Checkout repository
uses: actions/checkout@v4
-
name: Docker meta

- name: Set meta
id: meta
uses: docker/metadata-action@v5
with:
images: easzlab/kubeasz
images: ${{ env.REGISTRY }}/easzlab/kubeasz
tags: ${{ matrix.version }}
-
name: Set up QEMU

- name: Set up QEMU
uses: docker/setup-qemu-action@v3
-
name: Set up Docker Buildx

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
-
name: Login to DockerHub

- name: Login to the Container registry
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
-
name: Build and push
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push Docker image
id: push
uses: docker/build-push-action@v5
with:
build-args: KUBEASZ_VER=${{ matrix.version }}
Expand Down
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@

FROM easzlab/ansible:2.14.4-lite

ARG KUBEASZ_VER=3.3.2
# KUBEASZ_VER will be set by build-args
#ARG KUBEASZ_VER=3.3.2

ENV TZ="Asia/Shanghai"

Expand Down

0 comments on commit f18c68d

Please sign in to comment.