Skip to content

Instantly share code, notes, and snippets.

@dixneuf19
Created June 5, 2020 06:24
Show Gist options
  • Save dixneuf19/73e184fba935f0d1b641ed537caee353 to your computer and use it in GitHub Desktop.
Save dixneuf19/73e184fba935f0d1b641ed537caee353 to your computer and use it in GitHub Desktop.
name: buildx
on:
pull_request:
branches: master
push:
branches: master
tags:
jobs:
buildx:
runs-on: ubuntu-latest
steps:
# Get the repositery's code
- name: Checkout
uses: actions/checkout@v2
- name: Set up Docker Buildx
id: buildx
uses: crazy-max/ghaction-docker-buildx@v2
with: # in production, fix the version of your dependencies
buildx-version: latest
skip-cache: false
qemu-version: latest
- name: Available platforms
run: echo ${{ steps.buildx.outputs.platforms }}
# Build the images, without pushing
- name: Run Buildx
run: |
docker buildx build \
--platform linux/amd64,linux/arm64,linux/ppc64le,linux/s390x,linux/386,linux/arm/v7,linux/arm/v6 \
-t dixneuf19/pytime:${GITHUB_SHA::7} \
.
- name: Login to DockerHub
run: echo "${{ secrets.DOCKER_PASSWORD }}" | docker login -u "${{ secrets.DOCKER_USERNAME }}" --password-stdin
# Reusing the cache, push the images
- name: Run Buildx
run: |
docker buildx build \
--platform linux/amd64,linux/arm64,linux/ppc64le,linux/s390x,linux/386,linux/arm/v7,linux/arm/v6 \
-t dixneuf19/pytime:${GITHUB_SHA::7} \
. \
--push
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment