Fixed webshell image building failure in CI (#355) #53
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" | |
env: | |
K8S_VERSION: v1.23.6 # the same as Makefile | |
HELM_VERSION: v3.7.1 # the same as Makefile | |
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 | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Login in dockerhub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKER_NAME }} | |
password: ${{ secrets.DOCKER_PASSWORD }} | |
# TODO: for saving time and resources, webshell image should not be built every time | |
- name: Build and push webshell image | |
uses: docker/build-push-action@v5 | |
with: | |
context: . | |
file: ./docker/Dockerfile | |
platforms: linux/amd64,linux/arm64 | |
build-args: | | |
K8S_VERSION=${{ env.K8S_VERSION }} | |
HELM_VERSION=${{ env.HELM_VERSION }} | |
push: true | |
tags: | | |
${{ secrets.DOCKER_NAME }}/pixiu-webshell:latest | |
${{ secrets.DOCKER_NAME }}/pixiu-webshell:v0.1 | |
${{ secrets.DOCKER_NAME }}/pixiu-webshell:${{ env.COMMIT_HASH }} | |
- name: Build and push the pixiu image | |
uses: docker/build-push-action@v5 | |
with: | |
context: . | |
file: ./Dockerfile | |
platforms: linux/amd64,linux/arm64 | |
push: true | |
tags: | | |
${{ secrets.DOCKER_NAME }}/pixiu:latest | |
${{ secrets.DOCKER_NAME }}/pixiu:v0.1 | |
${{ secrets.DOCKER_NAME }}/pixiu:${{ env.COMMIT_HASH }} |