From 7cd9c3b5563ea2aba6007bfecd5a00c8ea5e8193 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B5=AA=E5=AD=90?= Date: Mon, 16 Dec 2024 10:26:52 +0800 Subject: [PATCH] Create deploy.yml --- .github/workflows/deploy.yml | 47 ++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 .github/workflows/deploy.yml diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..f3f8c73 --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,47 @@ +name: deploy Docker image +on: + push: + tags: + - "v*" +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Extract Version + id: version_step + run: | + echo "##[set-output name=version;]VERSION=${GITHUB_REF#$"refs/tags/v"}" + echo "##[set-output name=version_tag;]jkjoy/pleroma:${GITHUB_REF#$"refs/tags/v"}" + echo "##[set-output name=latest_tag;]jkjoy/pleroma:latest" + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Login to DockerHub + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKER_USER_NAME }} + password: ${{ secrets.DOCKER_ACCESS_TOKEN }} + + - name: PrepareReg Names + id: read-docker-image-identifiers + run: | + echo VERSION_TAG=$(echo ${{ steps.version_step.outputs.version_tag }} | tr '[:upper:]' '[:lower:]') >> $GITHUB_ENV + echo LASTEST_TAG=$(echo ${{ steps.version_step.outputs.latest_tag }} | tr '[:upper:]' '[:lower:]') >> $GITHUB_ENV + + - name: Build and push Docker images + id: docker_build + uses: docker/build-push-action@v5 + with: + push: true + context: . + platforms: | + linux/amd64 + linux/arm64 + tags: | + ${{env.VERSION_TAG}} + ${{env.LASTEST_TAG}} + build-args: | + ${{steps.version_step.outputs.version}}