39 lines
1.3 KiB
YAML
39 lines
1.3 KiB
YAML
name: Docker Build and Publish
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
push:
|
|
|
|
|
|
jobs:
|
|
docker-build-and-publish:
|
|
runs-on: bookworm
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Add Docker Repo
|
|
run: apt-get update &&
|
|
apt-get install -y ca-certificates curl &&
|
|
install -m 0755 -d /etc/apt/keyrings &&
|
|
curl -fsSL https://download.docker.com/linux/debian/gpg -o /etc/apt/keyrings/docker.asc &&
|
|
chmod a+r /etc/apt/keyrings/docker.asc &&
|
|
echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/debian $(. /etc/os-release && echo "$VERSION_CODENAME") stable" | tee /etc/apt/sources.list.d/docker.list > /dev/null &&
|
|
apt-get update
|
|
|
|
- name: Install Docker Buildx
|
|
run: apt-get install -y docker-buildx
|
|
|
|
- name: Login to Docker Hub
|
|
uses: docker/login-action@v3
|
|
with:
|
|
username: ${{ vars.DOCKERHUB_USERNAME }}
|
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
|
|
|
- name: build the image
|
|
run: |
|
|
docker buildx build \
|
|
--tag ${{ vars.DOCKERHUB_REPO }}:2.10.0 \
|
|
--tag ${{ vars.DOCKERHUB_REPO }}:latest \
|
|
--platform linux/amd64,linux/arm64 .
|