mirror of https://github.com/Lissy93/dashy.git
Update docker-image.yml
This commit is contained in:
parent
37f7d685fe
commit
502dcfb120
|
@ -1,24 +1,68 @@
|
||||||
name: ci-builx
|
name: Docker Build/Publish Image
|
||||||
|
on:
|
||||||
on:
|
push:
|
||||||
push:
|
branches: [ master ]
|
||||||
|
jobs:
|
||||||
jobs:
|
build:
|
||||||
buildx:
|
runs-on: ubuntu-18.04
|
||||||
runs-on: ubuntu-latest
|
env:
|
||||||
steps:
|
DOCKER_REGISTRY: kemansel.azurecr.io
|
||||||
-
|
DOCKER_IMAGE: kmansel/express-me
|
||||||
name: Checkout
|
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
|
||||||
uses: actions/checkout@v2
|
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
|
||||||
-
|
DOCKER_TARGET_PLATFORM: linux/arm/v7
|
||||||
name: Set up Docker Buildx
|
steps:
|
||||||
id: buildx
|
- name: Checkout the code
|
||||||
uses: docker/setup-buildx-action@v1
|
uses: actions/checkout@v1
|
||||||
-
|
- name: Set up Docker Buildx
|
||||||
name: Inspect builder
|
uses: crazy-max/ghaction-docker-buildx@v1
|
||||||
run: |
|
with:
|
||||||
echo "Name: ${{ steps.buildx.outputs.name }}"
|
version: latest
|
||||||
echo "Endpoint: ${{ steps.buildx.outputs.endpoint }}"
|
- name: Prepare
|
||||||
echo "Status: ${{ steps.buildx.outputs.status }}"
|
if: success()
|
||||||
echo "Flags: ${{ steps.buildx.outputs.flags }}"
|
id: prepare
|
||||||
echo "Platforms: ${{ steps.buildx.outputs.platforms }}"
|
run: |
|
||||||
|
echo ::set-output name=docker_platform::${DOCKER_TARGET_PLATFORM}
|
||||||
|
echo ::set-output name=docker_image::${DOCKER_REGISTRY}/${DOCKER_IMAGE}
|
||||||
|
echo ::set-output name=version::${GITHUB_RUN_NUMBER}
|
||||||
|
- name: Docker Login
|
||||||
|
if: success()
|
||||||
|
run: |
|
||||||
|
echo "${DOCKER_PASSWORD}" | docker login ${DOCKER_REGISTRY} --username "${DOCKER_USERNAME}" --password-stdin
|
||||||
|
- name: Run Buildx (push image)
|
||||||
|
if: success()
|
||||||
|
run: |
|
||||||
|
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 .name: Docker Build/Publish 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 }}
|
||||||
|
DOCKER_TARGET_PLATFORM: 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: Prepare
|
||||||
|
if: success()
|
||||||
|
id: prepare
|
||||||
|
run: |
|
||||||
|
echo ::set-output name=docker_platform::${DOCKER_TARGET_PLATFORM}
|
||||||
|
echo ::set-output name=docker_image::${DOCKER_REGISTRY}/${DOCKER_IMAGE}
|
||||||
|
echo ::set-output name=version::${GITHUB_RUN_NUMBER}
|
||||||
|
- 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 ${{ steps.prepare.outputs.docker_platform }} \ --tag ${{ steps.prepare.outputs.docker_image }}:${{ steps.prepare.outputs.version }} \ --file ./docker/Dockerfile-multi-arch \ --output type=image,push=true .
|
||||||
|
|
Loading…
Reference in New Issue