|
4 | 4 | build: |
5 | 5 | runs-on: ubuntu-latest |
6 | 6 | steps: |
7 | | - - uses: actions/checkout@master |
8 | | - - name: Publish to Registry |
9 | | - uses: elgohr/Publish-Docker-Github-Action@master |
10 | | - with: |
11 | | - name: fengkx/node_rssbot |
12 | | - snapshot: true |
13 | | - username: ${{ secrets.DOCKER_USERNAME }} |
14 | | - password: ${{ secrets.DOCKER_PASSWORD }} |
| 7 | + - name: Checkout |
| 8 | + uses: actions/checkout@v2 |
| 9 | + - name: Set up QEMU |
| 10 | + uses: docker/setup-qemu-action@v1 |
| 11 | + - name: Set up Docker Buildx |
| 12 | + uses: docker/setup-buildx-action@v1 |
| 13 | + - name: Login to DockerHub |
| 14 | + uses: docker/login-action@v1 |
| 15 | + with: |
| 16 | + username: ${{ secrets.DOCKER_USERNAME }} |
| 17 | + password: ${{ secrets.DOCKER_PASSWORD }} |
| 18 | + - name: output-docker-tag |
| 19 | + shell: bash |
| 20 | + id: docker-tag |
| 21 | + run: | |
| 22 | + BRANCH_NAME=`echo $GITHUB_REF | cut -d '/' -f3 -` |
| 23 | + echo "BRANCH_NAME: $BRANCH_NAME" |
| 24 | + unset IMG_TAGS ; if [[ $BRANCH_NAME == "master" ]]; then IMG_TAGS='latest' ; else IMG_TAGS="$BRANCH_NAME"; fi |
| 25 | + SHA_TAG=`echo $GITHUB_SHA | head -c 6` |
| 26 | + echo "SHA_TAG: $SHA_TAG" |
| 27 | + IMG_TAGS="$IMG_TAGS,$SHA_TAG" |
| 28 | + echo "IMAG_TAGS: $IMG_TAGS" |
| 29 | + echo ::set-output name=DOCKER_TAGS::${IMG_TAGS} |
| 30 | + - name: Build and push |
| 31 | + uses: docker/build-push-action@v2 |
| 32 | + with: |
| 33 | + context: . |
| 34 | + platforms: linux/amd64,linux/arm64,linux/arm/v7,linux/arm/v6 |
| 35 | + push: true |
| 36 | + tags: fengkx/node_rssbot:${{steps.docker-tag.outputs.DOCKER_TAGS}} |
0 commit comments