Skip to content

feat: ✨ docker platform #1

feat: ✨ docker platform

feat: ✨ docker platform #1

name: Build and Push Multi-arch Docker Image
on:
push:
branches: [master]
pull_request:
branches: [master]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "20"
- uses: pnpm/action-setup@v3
with:
version: latest
run_install: true
standalone: true
- name: Build
run: pnpm build:web-release
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- 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
uses: docker/build-push-action@v5
with:
context: .
platforms: linux/amd64,linux/arm64,linux/arm/v7
push: true
tags: |
registry.cn-beijing.aliyuncs.com/caorushizi/mediago:latest
registry.cn-beijing.aliyuncs.com/caorushizi/mediago:${{ github.sha }}