Create update-image.sh (#544) #205
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Publish pixiu image | |
on: | |
push: | |
branches: | |
- "master" | |
paths-ignore: | |
- 'docs/**' | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Get short commit hash | |
run: | | |
echo "COMMIT_HASH=$(git rev-parse --short HEAD)" >> $GITHUB_ENV | |
echo "TIMESTAMP=$(date +%Y%m%d%H%M%S)" >> $GITHUB_ENV | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Login harbor | |
uses: docker/login-action@v3 | |
with: | |
registry: harbor.cloud.pixiuio.com | |
username: ${{ secrets.HARBOR_USERNAME }} | |
password: ${{ secrets.HARBOR_PASSWORD }} | |
- name: Build and push the pixiu image | |
uses: docker/build-push-action@v5 | |
with: | |
context: . | |
file: ./Dockerfile | |
platforms: linux/amd64,linux/arm64 | |
build-args: | | |
VERSION=${{ env.COMMIT_HASH }}-${{ env.TIMESTAMP }} | |
push: true | |
tags: | | |
harbor.cloud.pixiuio.com/${{ secrets.HARBOR_PROJECT }}/pixiu:latest | |
harbor.cloud.pixiuio.com/${{ secrets.HARBOR_PROJECT }}/pixiu:v0.1 | |
harbor.cloud.pixiuio.com/${{ secrets.HARBOR_PROJECT }}/pixiu:${{ env.COMMIT_HASH }} |