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.

34 lines
1.1 KiB

  1. name: Build DockerHub
  2. on:
  3. push:
  4. branches: [ master, dev ]
  5. jobs:
  6. build:
  7. runs-on: ubuntu-latest
  8. steps:
  9. - name: checkout code
  10. uses: actions/checkout@v2
  11. - name: install buildx
  12. id: buildx
  13. uses: crazy-max/ghaction-docker-buildx@v1
  14. with:
  15. version: latest
  16. - name: login to docker hub
  17. run: |
  18. echo "${{ secrets.DOCKER_PASSWORD }}" | docker login -u "${{ secrets.DOCKER_USERNAME }}" --password-stdin
  19. - name: build and push the image (master branch)
  20. run: |
  21. docker buildx build \
  22. --push \
  23. --tag neilpang/acme.sh:latest \
  24. --platform linux/arm64/v8,linux/amd64,linux/arm/v6,linux/arm/v7,linux/386 .
  25. if: ${{ github.ref == 'refs/heads/master' }}
  26. - name: build and push the image (dev branch)
  27. run: |
  28. docker buildx build \
  29. --push \
  30. --tag neilpang/acme.sh:dev \
  31. --platform linux/arm64/v8,linux/amd64,linux/arm/v6,linux/arm/v7,linux/386 .
  32. if: ${{ github.ref == 'refs/heads/dev' }}