This commit is contained in:
Jordi Gutiérrez Hermoso 2024-06-20 13:40:33 -04:00
parent 0ca120a4f4
commit 75b2f0939d
2 changed files with 19 additions and 16 deletions

View File

@ -9,10 +9,17 @@ on:
jobs:
push_to_registry:
name: Push Docker image to Docker Hub
runs-on: ubuntu-latest
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: ubuntu-latest
platform: amd64
- os: ubuntu-latest-arm64
platform: arm64
steps:
- name: Check out the repo
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: Docker meta
id: meta
uses: docker/metadata-action@v4
@ -26,21 +33,19 @@ jobs:
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
stable
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
uses: docker/setup-buildx-action@v3
- name: Log in to Docker Hub
uses: docker/login-action@v1
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Push to Docker Hub
uses: docker/build-push-action@v2
uses: docker/build-push-action@v6
with:
context: .
push: true
platforms: linux/amd64,linux/arm64/v8
platforms: linux/${{ matrix.platform }}
tags: ${{ steps.meta.outputs.tags }}
cache-from: type=gha
cache-to: type=gha,mode=max

View File

@ -21,15 +21,13 @@ jobs:
node-version: [18.x]
steps:
- name: Check out the repo
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
ref: latest_candidate
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
uses: docker/setup-buildx-action@v3
- name: Prepare image but do not push it yet
uses: docker/build-push-action@v2
uses: docker/build-push-action@v6
with:
context: .
load: true
@ -54,15 +52,15 @@ jobs:
- name: Run tests
run: TEST_IMAGE=${{ github.repository_owner }}/grist VERBOSE=1 DEBUG=1 MOCHA_WEBDRIVER_HEADLESS=1 yarn run test:docker
- name: Log in to Docker Hub
uses: docker/login-action@v1
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Push to Docker Hub
uses: docker/build-push-action@v2
uses: docker/build-push-action@v6
with:
context: .
platforms: linux/amd64,linux/arm64/v8
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ github.repository_owner }}/grist:latest
cache-from: type=gha