WIP: Add 'platforms' option. Add test multi-plat build #12
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Docker Image CI | |
on: | |
push: | |
branches: [ "master" ] | |
pull_request: | |
branches: [ "master" ] | |
jobs: | |
build_and_push_to_registry: | |
name: Build and Push Docker image to Docker Hub | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out the repo | |
uses: actions/checkout@v3 | |
- name: Log in to Docker Hub | |
uses: docker/login-action@v2 | |
with: | |
username: ${{ secrets.DOCKER_HUB_USERNAME }} | |
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} | |
- name: Set up qemu | |
uses: docker/setup-qemu-action@v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Build and push Docker image | |
uses: docker/build-push-action@v5 | |
with: | |
context: . | |
file: ./Dockerfile | |
push: true | |
tags: ingv/hyp2000:latest | |
platforms: linux/amd64,linux/arm64 | |
#tags: ${{ steps.meta.outputs.tags }} | |
#labels: ${{ steps.meta.outputs.labels }} | |
- name: Push README to Dockerhub | |
uses: christian-korneck/update-container-description-action@v1 | |
env: | |
DOCKER_USER: ${{ secrets.DOCKER_HUB_USERNAME }} | |
DOCKER_PASS: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} | |
with: | |
provider: dockerhub | |
destination_container_repo: ingv/hyp2000 | |
readme_file: 'README.md' | |
short_description: 'Hypoinvers 2000' | |
#- uses: actions/checkout@v3 | |
#- name: Build the Docker image | |
# run: docker build . --file Dockerfile --tag my-image-name:$(date +%s) |