Skip to content

Commit

Permalink
ci: try github container registry
Browse files Browse the repository at this point in the history
  • Loading branch information
holishing committed Dec 16, 2024
1 parent 1957dd4 commit 8fc6d79
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 16 deletions.
28 changes: 20 additions & 8 deletions .github/workflows/push_container.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,13 @@ name: push container

on:
push:
branches:
- master
branches: master
schedule:
- cron: "30 0 * * 2/5"
- cron: "30 0 * * 2,5"

env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}

jobs:
main:
Expand All @@ -22,19 +25,28 @@ jobs:
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
# -
# name: Login to DockerHub
# uses: docker/login-action@v3
# with:
# username: ${{ secrets.DOCKERHUB_USERNAME }}
# password: ${{ secrets.DOCKERHUB_TOKEN }}
-
name: Login to DockerHub
name: Login to Container Registry
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
-
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
-
name: Build and push
id: docker_build
uses: docker/build-push-action@v5
with:
push: true
tags: bbsdocker/imageptt:latest,bbsdocker/imageptt:${{ steps.date.outputs.date }}
tags: |
ghcr.io/bbsdocker/imageptt:latest
ghcr.io/bbsdocker/imageptt:${{ steps.date.outputs.date }}
platforms: linux/amd64, linux/arm64
build-args: |
MY_DEBIAN_VERSION=bullseye
Expand Down
22 changes: 18 additions & 4 deletions .github/workflows/push_container_sid.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ on:
schedule:
- cron: "30 16 * * 0,4"

env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}

jobs:
main:
if: "!contains(github.event.head_commit.message, 'skip-ci')"
Expand All @@ -21,19 +25,29 @@ jobs:
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
# -
# name: Login to DockerHub
# uses: docker/login-action@v3
# with:
# username: ${{ secrets.DOCKERHUB_USERNAME }}
# password: ${{ secrets.DOCKERHUB_TOKEN }}
-
name: Login to DockerHub
name: Login to Container Registry
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
-
name: Build and push
id: docker_build
uses: docker/build-push-action@v5
with:
push: true
tags: bbsdocker/imageptt:sid,bbsdocker/imageptt:sid-latest,bbsdocker/imageptt:sid-${{ steps.date.outputs.date }}
tags: |
ghcr.io/bbsdocker/imageptt:sid
ghcr.io/bbsdocker/imageptt:sid-latest
ghcr.io/bbsdocker/imageptt:sid-${{ steps.date.outputs.date }}
platforms: linux/amd64, linux/arm64
build-args: |
MY_DEBIAN_VERSION=sid
Expand Down
22 changes: 18 additions & 4 deletions .github/workflows/push_container_testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ on:
schedule:
- cron: "30 16 * * 0,4"

env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}

jobs:
main:
if: "!contains(github.event.head_commit.message, 'skip-ci')"
Expand All @@ -21,19 +25,29 @@ jobs:
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
# -
# name: Login to DockerHub
# uses: docker/login-action@v3
# with:
# username: ${{ secrets.DOCKERHUB_USERNAME }}
# password: ${{ secrets.DOCKERHUB_TOKEN }}
-
name: Login to DockerHub
name: Login to Container Registry
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
-
name: Build and push
id: docker_build
uses: docker/build-push-action@v5
with:
push: true
tags: bbsdocker/imageptt:bookworm,bbsdocker/imageptt:bookworm-latest,bbsdocker/imageptt:bookworm-${{ steps.date.outputs.date }}
tags: |
ghcr.io/bbsdocker/imageptt:bookworm
ghcr.io/bbsdocker/imageptt:bookworm-latest
ghcr.io/bbsdocker/imageptt:bookworm-${{ steps.date.outputs.date }}
platforms: linux/amd64, linux/arm64
build-args: |
MY_DEBIAN_VERSION=bookworm
Expand Down

0 comments on commit 8fc6d79

Please sign in to comment.