endlessh-go/.github/workflows/docker-hub-build-push-on-release.yml
Shizun Ge db59b50993
remove linux/ppc64le
We saw the following error during `go mod tidy`
```
#52 60.57 endlessh-go imports
#52 60.57 	github.com/golang/glog: github.com/golang/glog@v1.0.0: Get "https://proxy.golang.org/github.com/golang/glog/@v/v1.0.0.zip": net/http: TLS handshake timeout
#52 60.57 endlessh-go imports
#52 60.57 	github.com/pierrre/geohash: github.com/pierrre/geohash@v1.0.0: Get "https://proxy.golang.org/github.com/pierrre/geohash/@v/v1.0.0.zip": net/http: TLS handshake timeout
```
2022-03-08 21:36:18 -08:00

62 lines
2.1 KiB
YAML

name: Build docker image and push to docker hub on release
on:
release:
types: # This configuration does not affect the page_build event above
- created
env:
PLATFORMS: "linux/amd64,linux/386,linux/arm64,linux/arm/v7,linux/arm/v6,linux/s390x"
jobs:
build_and_push:
name: Build and push Docker image
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Extract tag string
id: git
shell: bash
run: |
RELEASE_VERSION=${GITHUB_REF#refs/*/}
echo "::set-output name=image_tag::${RELEASE_VERSION}"
echo "Action image_tag=${RELEASE_VERSION}"
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Install buildx
uses: docker/setup-buildx-action@v1.6.0
- name: Login to docker hub
uses: docker/login-action@v1.14.1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
- name: Login to GitHub Container Registry
uses: docker/login-action@v1.14.1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ github.token }}
- 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
ghcr.io/${{ github.repository }}:${{ steps.git.outputs.image_tag }}
ghcr.io/${{ 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 }}