used builtin actions.

This commit is contained in:
Kashif Sohail 2021-12-14 21:07:27 +05:00 committed by GitHub
parent 058a94aa45
commit d6e1cdaf2d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 34 additions and 27 deletions

View File

@ -1,28 +1,35 @@
name: Docker Build/Publish Image name: Build Multiplatform Image
on:
push:
branches: [ master ]
jobs:
build:
runs-on: ubuntu-18.04
env:
DOCKER_IMAGE: kshfse/dashy
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
TARGETPLATFORM: linux/arm/v7
steps:
- name: Checkout the code
uses: actions/checkout@v1
- name: Set up Docker Buildx
uses: crazy-max/ghaction-docker-buildx@v1
with:
version: latest
- name: Docker Login
if: success()
run: |
echo "${DOCKER_PASSWORD}" | docker login --username "${DOCKER_USERNAME}" --password-stdin
- name: Run Buildx (push image)
if: success()
run: |
docker buildx build --platform linux/amd64,linux/arm64,linux/arm/v7 --tag kshfse/dashy:latest --file ./docker/Dockerfile-multi-arch --output type=image,push=true .
on:
push:
branches:
- 'master'
jobs:
docker:
runs-on: ubuntu-latest
steps:
-
name: Checkout
uses: actions/checkout@v2
-
name: Set up QEMU
uses: docker/setup-qemu-action@v1
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
-
name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
-
name: Build and push
uses: docker/build-push-action@v2
with:
context: .
dockerfile: ./docker/Dockerfile-multi-arch
platforms: linux/amd64,linux/arm64,linux/arm/v7
push: true
tags: ${{ secrets.DOCKER_REPO }}:latest