Skip to content

自动构建docker镜像Armv7 #25

自动构建docker镜像Armv7

自动构建docker镜像Armv7 #25

name: 自动构建docker镜像Armv7
on:
schedule:
- cron: "21 19 * * 0"
watch:
types: started
workflow_dispatch:
# push:
# branches: [ main ]
# pull_request:
# branches: [ main ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Check Out Repo
uses: actions/checkout@v3
# - name: Login to GHCR
# if: github.event_name != 'pull_request'
# uses: docker/login-action@v2
# with:
# registry: ghcr.io
# username: ${{ github.repository_owner }}
# password: ${{ secrets.GITHUB_TOKEN }}
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Docker meta
id: meta
uses: docker/metadata-action@v4
with:
# list of Docker images to use as base name for tags
images: |
${{ secrets.DOCKER_USERNAME }}/samba
# ghcr.io/username/app
# generate Docker tags based on the following events/attributes
tags: |
type=raw,value=arm
# {{date 'YYYY/MM/DD'}}
# type=schedule,pattern={{date 'YYYY/MM/DD'}}
# type=semver,pattern={{version}}
# type=semver,pattern=$()
# type=ref,event=branch
# type=sha
# type=ref,event=pr
# type=semver,pattern={{major}}.{{minor}}
# type=semver,pattern={{major}}
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v2
- name: Build and push all
id: docker_build_all
uses: docker/build-push-action@v4
with:
context: ./dockerfile/
file: ./dockerfile/Dockerfile_armv7
push: true
platforms: linux/arm
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
- name: all Image digest
run: echo ${{ steps.docker_build_all.outputs.digest }}