Skip to content

build image and push to DockerHub #128

build image and push to DockerHub

build image and push to DockerHub #128

Workflow file for this run

name: build image and push to DockerHub
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
schedule:
- cron: "0 0 * * 0"
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3.0.0
with:
platforms: all
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v3.3.0
- name: Login to DockerHub
if: github.event_name != 'pull_request'
uses: docker/login-action@v3.2.0
with:
username: xr09
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
- name: Push latest
id: docker_build_latest
uses: docker/build-push-action@v5.3.0
with:
builder: ${{ steps.buildx.outputs.name }}
context: ./
file: ./Dockerfile
platforms: linux/amd64,linux/arm/v7,linux/arm64
push: ${{ github.event_name != 'pull_request' }}
pull: true
cache-from: type=registry,ref=xr09/alpine-bash:latest
cache-to: type=inline
provenance: false
tags: |
xr09/alpine-bash:latest