You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by wu...@apache.org on 2023/04/25 14:13:16 UTC
[skywalking-python] branch master updated: Push Docker images on release (#305)
This is an automated email from the ASF dual-hosted git repository.
wusheng pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/skywalking-python.git
The following commit(s) were added to refs/heads/master by this push:
new 4717e1b Push Docker images on release (#305)
4717e1b is described below
commit 4717e1b66da9fd9025ef8e7f5f9bab1c4b1e409e
Author: kezhenxu94 <ke...@apache.org>
AuthorDate: Tue Apr 25 22:13:11 2023 +0800
Push Docker images on release (#305)
---
.github/workflows/publish-docker.yaml | 38 ++++++++++++++++++++++++++---------
1 file changed, 28 insertions(+), 10 deletions(-)
diff --git a/.github/workflows/publish-docker.yaml b/.github/workflows/publish-docker.yaml
index 2b033e1..937e757 100644
--- a/.github/workflows/publish-docker.yaml
+++ b/.github/workflows/publish-docker.yaml
@@ -21,10 +21,9 @@ on:
push:
branches:
- master
-
-env:
- HUB: ghcr.io/apache/skywalking-python
- PROJECT: skywalking-python
+ release:
+ types:
+ - released
jobs:
build-docker:
@@ -40,12 +39,31 @@ jobs:
- uses: actions/checkout@v2
with:
submodules: true
+ - name: Set environment variables
+ run: |
+ if [[ ${{ github.event_name }} == "release" ]]; then
+ echo "HUB=apache" >> $GITHUB_ENV
+ echo "DOCKER_REGISTRY=docker.io" >> $GITHUB_ENV
+ echo "DOCKER_USERNAME=${{ secrets.DOCKERHUB_USER }}" >> $GITHUB_ENV
+ echo "DOCKER_PASSWORD=${{ secrets.DOCKERHUB_TOKEN }}" >> $GITHUB_ENV
+ TAG=${{ github.event.release.tag_name }}
+ echo "TAG=${TAG#v}" >> $GITHUB_ENV
+ else
+ echo "HUB=ghcr.io/apache/skywalking" >> $GITHUB_ENV
+ echo "DOCKER_REGISTRY=ghcr.io/apache/skywalking-python" >> $GITHUB_ENV
+ echo "DOCKER_USERNAME=${{ github.actor }}" >> $GITHUB_ENV
+ echo "DOCKER_PASSWORD=${{ secrets.GITHUB_TOKEN }}" >> $GITHUB_ENV
+ echo "TAG=${{ github.sha }}" >> $GITHUB_ENV
+ fi
- name: Log in to the Container registry
- uses: docker/login-action@v1.10.0
+ uses: docker/login-action@v2
with:
- registry: ${{ env.HUB }}
- username: ${{ github.actor }}
- password: ${{ secrets.GITHUB_TOKEN }}
+ registry: ${{ env.DOCKER_REGISTRY }}
+ username: ${{ env.DOCKER_USERNAME }}
+ password: ${{ env.DOCKER_PASSWORD }}
+ - name: Set up QEMU
+ uses: docker/setup-qemu-action@v1
+ - name: Set up Docker Buildx
+ uses: docker/setup-buildx-action@v1
- name: Build and push docker image
- run: |
- make push-image -j 5
+ run: make push-image -j 5