PagerMaid-Pyro/.github/workflows/docker.yml

50 lines
1.4 KiB
YAML
Raw Normal View History

2022-05-25 03:33:32 +00:00
name: "Docker Build"
# Controls when the action will run.
on:
# Triggers the workflow on push or pull request events but only for the master branch
workflow_dispatch: ~
push:
branches: [ master ]
jobs:
build:
runs-on: ubuntu-latest
name: docker build and publish
env:
DOCKER_BUILDKIT: 1
DOCKER_CLI_EXPERIMENTAL: enabled
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKERHUB_REPOSITORY: ${{ secrets.DOCKER_REPO }}
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_TOKEN }}
- name: Setup Docker Buildx
uses: crazy-max/ghaction-docker-buildx@v3
- name: Buildx cache
uses: actions/cache@v2
id: buildx-cache
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx
- name: Build
run: |
docker buildx build \
--cache-from "type=local,src=/tmp/.buildx-cache" \
--cache-to "type=local,dest=/tmp/.buildx-cache" \
--output "type=image,push=true" \
2023-01-16 06:05:54 +00:00
--platform "linux/amd64,linux/arm64/v8" \
2022-05-25 03:33:32 +00:00
--build-arg "S6_ARCH=amd64" \
2023-01-16 06:05:54 +00:00
--tag "${DOCKERHUB_REPOSITORY}:latest" \
2022-05-25 03:33:32 +00:00
-f Dockerfile \
.