Push dockerhub description
This commit is contained in:
parent
015f50b5f7
commit
f5307aef4b
1 changed files with 40 additions and 18 deletions
|
|
@ -1,28 +1,50 @@
|
||||||
name: build docker image and push to docker hub on release
|
name: Build docker image and push to docker hub on release
|
||||||
|
|
||||||
on:
|
on:
|
||||||
release:
|
release:
|
||||||
types: # This configuration does not affect the page_build event above
|
types: # This configuration does not affect the page_build event above
|
||||||
- created
|
- created
|
||||||
|
env:
|
||||||
|
PLATFORMS: "linux/amd64,linux/386,linux/arm64,linux/arm/v7,linux/arm/v6"
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build_and_push:
|
||||||
|
name: Build and push Docker image
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
- name: extract tag string
|
|
||||||
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
|
- name: Extract tag string
|
||||||
- name: install buildx
|
id: git
|
||||||
id: buildx
|
shell: bash
|
||||||
uses: crazy-max/ghaction-docker-buildx@v1
|
|
||||||
with:
|
|
||||||
version: latest
|
|
||||||
- name: login to docker hub
|
|
||||||
run: echo "${{ secrets.DOCKER_PASSWORD }}" | docker login -u "${{ secrets.DOCKER_USERNAME }}" --password-stdin
|
|
||||||
- name: build and push the image
|
|
||||||
run: |
|
run: |
|
||||||
docker buildx build --push \
|
RELEASE_VERSION=${GITHUB_REF#refs/*/}
|
||||||
--tag shizunge/endlessh-go:latest \
|
echo "::set-output name=image_tag::${RELEASE_VERSION}"
|
||||||
--tag shizunge/endlessh-go:$RELEASE_VERSION \
|
echo "Action image_tag=${RELEASE_VERSION}"
|
||||||
--platform linux/amd64,linux/arm/v7,linux/arm64 .
|
|
||||||
|
- name: Login to docker hub
|
||||||
|
uses: docker/login-action@v1.12.0
|
||||||
|
with:
|
||||||
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||||
|
password: ${{ secrets.DOCKERHUB_PASSWORD }}
|
||||||
|
|
||||||
|
- name: Install buildx
|
||||||
|
uses: docker/setup-buildx-action@v1.6.0
|
||||||
|
|
||||||
|
- name: Build and push ${{ github.repository }}:${{ steps.git.outputs.image_tag }}
|
||||||
|
uses: docker/build-push-action@v2.9.0
|
||||||
|
with:
|
||||||
|
platforms: ${{ env.PLATFORMS }}
|
||||||
|
push: true
|
||||||
|
tags: |
|
||||||
|
${{ github.repository }}:${{ steps.git.outputs.image_tag }}
|
||||||
|
${{ github.repository }}:latest
|
||||||
|
|
||||||
|
- name: Update dockerhub description
|
||||||
|
uses: peter-evans/dockerhub-description@v2.4.3
|
||||||
|
with:
|
||||||
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||||
|
password: ${{ secrets.DOCKERHUB_PASSWORD }}
|
||||||
|
repository: ${{ github.repository }}
|
||||||
|
short-description: ${{ github.event.repository.description }}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue