Skip to content

Commit

Permalink
Test workflow with platform ARM
Browse files Browse the repository at this point in the history
  • Loading branch information
Nazarii committed Jan 3, 2025
1 parent dff7909 commit 845f09d
Showing 1 changed file with 20 additions and 12 deletions.
32 changes: 20 additions & 12 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,45 +2,53 @@ name: Docker Image CI

on:
push:
branches: [ master ]
branches: [ blog ]
workflow_dispatch:

env:
DOCKER_IMAGE_REPO: bandirom/django-template
REGISTRY: docker.io
DOCKER_IMAGE_REPO: bandirom/django-blog
TARGET_PLATFORMS: linux/amd64,linux/arm64

jobs:
tests:
uses: ./.github/workflows/tests.yml
secrets: inherit
# tests:
# uses: ./.github/workflows/tests.yml
# secrets: inherit
push:
runs-on: ubuntu-latest
needs: [tests]
# needs: [tests]
steps:
- name: Checkout Repo
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.DOCKER_IMAGE_REPO }}
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=sha,format=short,prefix=
type=schedule
type=ref,event=branch
type=ref,event=tag
type=ref,event=pr
type=sha
- name: Build and push
uses: docker/build-push-action@v5
uses: docker/build-push-action@v6
with:
push: ${{ github.event_name != 'pull_request' }}
context: .
tags: |
${{ steps.meta.outputs.tags }}
${{ env.DOCKER_IMAGE_REPO }}:latest
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
platforms: ${{ env.TARGET_PLATFORMS }}
file: docker/prod/web/Dockerfile
cache-from: type=registry,ref=${{ env.DOCKER_IMAGE_REPO }}:latest
cache-to: type=inline

0 comments on commit 845f09d

Please sign in to comment.