mirror of
https://github.com/TeamPGM/PagerMaid-Pyro.git
synced 2024-11-25 18:15:27 +00:00
43 lines
1.3 KiB
YAML
43 lines
1.3 KiB
YAML
|
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
|
||
|
steps:
|
||
|
- name: Checkout
|
||
|
uses: actions/checkout@v4
|
||
|
|
||
|
- name: Login to DockerHub
|
||
|
uses: docker/login-action@v3
|
||
|
with:
|
||
|
username: ${{ secrets.DOCKER_USERNAME }}
|
||
|
password: ${{ secrets.DOCKER_TOKEN }}
|
||
|
|
||
|
# https://github.com/docker/setup-qemu-action
|
||
|
- name: Set up QEMU
|
||
|
uses: docker/setup-qemu-action@v3
|
||
|
# https://github.com/docker/setup-buildx-action
|
||
|
- name: Set up Docker Buildx
|
||
|
uses: docker/setup-buildx-action@v3
|
||
|
|
||
|
- name: Build
|
||
|
run: |
|
||
|
PGM_VERSION=$(python .github/get_version.py)
|
||
|
docker buildx build \
|
||
|
--cache-to "type=local,dest=/tmp/.buildx-cache" \
|
||
|
--output "type=image,push=true" \
|
||
|
--platform "linux/amd64,linux/arm64/v8" \
|
||
|
--build-arg "S6_ARCH=amd64" \
|
||
|
--tag "${{ secrets.DOCKER_REPO }}:latest" \
|
||
|
--tag "${{ secrets.DOCKER_REPO }}:${PGM_VERSION}" \
|
||
|
-f Dockerfile \
|
||
|
.
|