Skip to content

Kspider Docker Image CI #26

Kspider Docker Image CI

Kspider Docker Image CI #26

Workflow file for this run

name: Kspider Docker Image CI
on:
release:
types: [published]
permissions:
packages: write
contents: read
attestations: write
id-token: write
jobs:
build_push_dockerhub:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Login to Aliyun Container Registry
uses: docker/login-action@v3
with:
registry: registry.cn-beijing.aliyuncs.com
username: ${{ secrets.ALIYUN_USERNAME }}
password: ${{ secrets.ALIYUN_PASSWORD }}
- name: Build and push Docker image
uses: docker/build-push-action@v6
id: build_push_dockerhub
with:
file: Dockerfile
push: true
tags: |
${{ github.repository }}:latest
${{ github.repository }}:${{ github.event.release.tag_name }}
ghcr.io/${{ github.repository }}:latest
ghcr.io/${{ github.repository }}:${{ github.event.release.tag_name }}
registry.cn-beijing.aliyuncs.com/${{ github.repository }}:latest
registry.cn-beijing.aliyuncs.com/${{ github.repository }}:${{ github.event.release.tag_name }}
- name: Generate artifact attestation
uses: actions/attest-build-provenance@v1
with:
subject-name: ghcr.io/${{ github.repository }}
subject-digest: ${{ steps.build_push_dockerhub.outputs.digest }}
push-to-registry: true