builder official #9
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: builder official | |
on: | |
workflow_dispatch: | |
jobs: | |
buildx: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
submodules: true | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Cache Docker layers | |
uses: actions/cache@v4 | |
with: | |
path: /tmp/.buildx-cache | |
key: ${{ runner.os }}-buildx-${{ github.sha }} | |
restore-keys: | | |
${{ runner.os }}-buildx- | |
- name: Login to DockerHub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.repository_owner }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Lower case dockerhub image name | |
id: dockerhub_image | |
uses: ASzc/change-string-case-action@v6 | |
with: | |
string: ${{ secrets.DOCKERHUB_USERNAME }}/${{ github.event.repository.name }} | |
- name: Lower case github docker image name | |
id: ghcr_image | |
uses: ASzc/change-string-case-action@v6 | |
with: | |
string: ${{ github.repository }} | |
- name: Build and push with latest tag | |
uses: docker/build-push-action@v5 | |
with: | |
context: build_image | |
platforms: linux/amd64,linux/arm64,linux/s390x,linux/arm/v7 | |
push: true | |
tags: | | |
${{ steps.dockerhub_image.outputs.lowercase }}:latest | |
ghcr.io/${{ steps.ghcr_image.outputs.lowercase }}:latest | |
cache-from: type=gha | |
cache-to: type=gha,mode=max |