44
55 push :
66 branches : [ main ]
7- jobs :
8- build :
9- runs-on : ubuntu-18.04
10- env :
11- DOCKER_REGISTRY : registry.hub.docker.com/pathonscript/botsofcode
12- DOCKER_IMAGE : pathonscript/botsofcode
13- DOCKER_USERNAME : ${{ secrets.DOCKER_USERNAME }}
14- DOCKER_PASSWORD : ${{ secrets.DOCKER_PASSWORD }}
15- DOCKER_TARGET_PLATFORM : linux/arm/v7
16- steps :
17- - name : Checkout the code
18- uses : actions/checkout@v1
19- # https://github.com/docker/setup-qemu-action
20- - name : Set up QEMU
21- uses : docker/setup-qemu-action@v1
22- # https://github.com/docker/setup-buildx-action
23- - name : Set up Docker Buildx
24- uses : docker/setup-buildx-action@v1
25- - name : Prepare
26- if : success()
27- id : prepare
28- run : |
29- echo ::set-output name=docker_platform::${DOCKER_TARGET_PLATFORM}
30- echo ::set-output name=docker_image::${DOCKER_REGISTRY}/${DOCKER_IMAGE}
31- echo ::set-output name=version::${GITHUB_RUN_NUMBER}
32- - name : Docker Login
33- if : success()
34- run : |
35- echo "${DOCKER_PASSWORD}" | docker login ${DOCKER_REGISTRY} --username "${DOCKER_USERNAME}" --password-stdin
36- - name : Run Buildx (push image)
37- if : success()
38- run : |
39- docker buildx build \ --platform ${{ steps.prepare.outputs.docker_platform }} \ --tag ${{ steps.prepare.outputs.docker_image }}:${{ steps.prepare.outputs.version }} \ --file ./Dockerfile \ --output type=image,push=true .
7+
8+ jobs :
9+ docker :
10+ runs-on : ubuntu-latest
11+ steps :
12+ -
13+ name : Set up QEMU
14+ uses : docker/setup-qemu-action@v2
15+ -
16+ name : Set up Docker Buildx
17+ uses : docker/setup-buildx-action@v2
18+ -
19+ name : Login to DockerHub
20+ uses : docker/login-action@v2
21+ with :
22+ username : ${{ secrets.DOCKERHUB_USERNAME }}
23+ password : ${{ secrets.PASSWORD }}
24+ -
25+ name : Build and push
26+ uses : docker/build-push-action@v3
27+ with :
28+ push : true
29+ tags : pathonscript/botsofcode:latest
30+ # if: success()
31+ # run: |
32+ # docker buildx build \ --platform ${{ steps.prepare.outputs.docker_platform }} \ --tag ${{ steps.prepare.outputs.docker_image }}:${{ steps.prepare.outputs.version }} \ --file ./Dockerfile \ --output type=image,push=true .
0 commit comments