name: Publish Gateway to Docker Hub on: push: tags: ["gateway-v*"] workflow_dispatch: env: IMAGE_NAME: nickname4th/linkshell-gateway jobs: publish: runs-on: ubuntu-latest permissions: contents: read steps: - uses: actions/checkout@v4 - name: Docker meta id: meta uses: docker/metadata-action@v5 with: images: ${{ env.IMAGE_NAME }} tags: | type=match,pattern=gateway-v(.*),group=1 type=match,pattern=gateway-v(\d+\.\d+)\.\d+,group=1 type=raw,value=latest - uses: docker/setup-buildx-action@v3 - name: Login to Docker Hub uses: docker/login-action@v3 with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} - name: Build and push uses: docker/build-push-action@v6 with: context: . file: packages/gateway/Dockerfile push: true tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} cache-from: type=gha cache-to: type=gha,mode=max