Merge pull request #103 from cita-cloud/upgrade_deps #144
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: Build Docker Images | |
on: | |
push: | |
branches: | |
- master | |
- main | |
- 'v*' | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: [self-hosted, Linux, alibaba-cloud] | |
defaults: | |
run: | |
shell: bash | |
steps: | |
- name: "Checking out code" | |
uses: actions/checkout@v2 | |
with: | |
submodules: recursive | |
- name: "Login to DockerHub" | |
uses: docker/login-action@v2 | |
with: | |
registry: ${{ secrets.DOCKER_REGISTRY_ADDRESS }} | |
username: ${{ secrets.DOCKER_REGISTRY_USERNAME }} | |
password: ${{ secrets.DOCKER_REGISTRY_PASSWORD }} | |
- name: "Set up QEMU" | |
uses: docker/setup-qemu-action@v1 | |
with: | |
image: tonistiigi/binfmt:master | |
- name: "Set up Docker Buildx" | |
uses: docker/setup-buildx-action@v1 | |
- name: "Building docker images" | |
run: | | |
image="${{ secrets.DOCKER_REGISTRY_ADDRESS }}/cita-cloud/$(basename ${GITHUB_REPOSITORY})" | |
tag=${GITHUB_REF#refs/heads/} | |
if [ "$tag" = 'master' ] || [ "$tag" = 'main' ]; then | |
tag=latest | |
fi | |
docker buildx build \ | |
--output "type=image,push=true" \ | |
--file "Dockerfile" \ | |
--tag "${image}:${tag}" \ | |
--platform "linux/amd64" \ | |
"." | |