Skip to content

main branch

main branch #141

name: Build and Push docker image
on:
push:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
-
name: Set up QEMU
uses: docker/setup-qemu-action@v3
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
-
name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
-
name: Build and push
uses: docker/build-push-action@v5
with:
push: true
tags: ${{ secrets.DOCKERHUB_USERNAME }}/joke-app:latest, ${{ secrets.DOCKERHUB_USERNAME }}/joke-app:${{ github.sha }}
platforms: linux/amd64,linux/arm64
cache-from: type=registry,ref=${{ secrets.DOCKERHUB_USERNAME }}/joke-app:buildcache
cache-to: type=registry,ref=${{ secrets.DOCKERHUB_USERNAME }}/joke-app:buildcache,mode=max