Skip to content

Commit

Permalink
build: added github registry
Browse files Browse the repository at this point in the history
Signed-off-by: Armin Schlegel <[email protected]>
  • Loading branch information
siredmar committed Jul 3, 2023
1 parent 211cb4f commit 966e584
Showing 1 changed file with 30 additions and 2 deletions.
32 changes: 30 additions & 2 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@ on:
- "v*"
schedule:
# run at UTC 1:30 every day
- cron: '30 1 * * *'
- cron: "30 1 * * *"
workflow_dispatch: {}

env:
ALI_REGISTRY: registry.cn-hangzhou.aliyuncs.com/openyurt
GITHUB_REGISTRY: ghcr.io/openyurtio/openyurt

jobs:
docker-push:
Expand Down Expand Up @@ -65,4 +66,31 @@ jobs:
username: ${{ secrets.ALI_REGISTRY_USERNAME }}
password: ${{ secrets.ALI_REGISTRY_PASSWORD }}
- name: Release
run: make docker-push TARGET_PLATFORMS=linux/amd64,linux/arm64,linux/arm/v7 IMAGE_REPO=${{ env.ALI_REGISTRY }} IMAGE_TAG=${{ steps.get_version.outputs.VERSION }}
run: make docker-push TARGET_PLATFORMS=linux/amd64,linux/arm64,linux/arm/v7 IMAGE_REPO=${{ env.ALI_REGISTRY }} IMAGE_TAG=${{ steps.get_version.outputs.VERSION }}
docker-push-github-registry:
if: github.repository == 'openyurtio/openyurt'
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: true
- name: Get the version
id: get_version
run: |
VERSION=${GITHUB_REF#refs/tags/}
if [[ ${GITHUB_REF} == "refs/heads/master" ]]; then
VERSION=latest
fi
echo ::set-output name=VERSION::${VERSION}
- name: Install Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v2
- name: Login to DockerHub
uses: docker/login-action@v2
with:
registry: ${{ env.GITHUB_REGISTRY }}
username: ${{ secrets.GITHUB_REGISTRY_USERNAME }}
password: ${{ secrets.GITHUB_REGISTRY_PASSWORD }}
- name: Release
run: make docker-push TARGET_PLATFORMS=linux/amd64,linux/arm64,linux/arm/v7 IMAGE_REPO=${{ env.GITHUB_REGISTRY }} IMAGE_TAG=${{ steps.get_version.outputs.VERSION }}

0 comments on commit 966e584

Please sign in to comment.