You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

46 lines
1.3 KiB

4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
  1. name: Build DockerHub
  2. on:
  3. push:
  4. branches:
  5. - '*'
  6. tags:
  7. - '*'
  8. jobs:
  9. build:
  10. runs-on: ubuntu-latest
  11. steps:
  12. - name: checkout code
  13. uses: actions/checkout@v2
  14. - name: install buildx
  15. id: buildx
  16. uses: crazy-max/ghaction-docker-buildx@v3
  17. with:
  18. buildx-version: latest
  19. qemu-version: latest
  20. - name: login to docker hub
  21. run: |
  22. echo "${{ secrets.DOCKER_PASSWORD }}" | docker login -u "${{ secrets.DOCKER_USERNAME }}" --password-stdin
  23. - name: build and push the image
  24. run: |
  25. DOCKER_IMAGE=neilpang/acme.sh
  26. if [[ $GITHUB_REF == refs/tags/* ]]; then
  27. DOCKER_IMAGE_TAG=${GITHUB_REF#refs/tags/}
  28. fi
  29. if [[ $GITHUB_REF == refs/heads/* ]]; then
  30. DOCKER_IMAGE_TAG=${GITHUB_REF#refs/heads/}
  31. if [[ $DOCKER_IMAGE_TAG == master ]]; then
  32. DOCKER_IMAGE_TAG=latest
  33. AUTO_UPGRADE=1
  34. fi
  35. fi
  36. docker buildx build \
  37. --tag ${DOCKER_IMAGE}:${DOCKER_IMAGE_TAG} \
  38. --output "type=image,push=true" \
  39. --build-arg AUTO_UPGRADE=${AUTO_UPGRADE} \
  40. --platform linux/arm64/v8,linux/amd64,linux/arm/v6,linux/arm/v7,linux/386 .