Kon/.gitea/workflows/build.yml
toast 67116539ab
Some checks failed
Build and push container image / build (push) Has been cancelled
Add build and deploy workflows
2023-12-08 22:25:57 +11:00

38 lines
1.4 KiB
YAML

name: Build and push container image
on:
push:
branches:
- master
jobs:
build:
runs-on: ubuntu-22.04-node
steps:
- name: Install and setup Docker
run: |
apt update
apt install -y apt-transport-https ca-certificates curl gnupg lsb-release
curl -fsSL https://download.docker.com/linux/debian/gpg | gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
echo \
"deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/debian \
$(lsb_release -cs) stable" | tee /etc/apt/sources.list.d/docker.list > /dev/null
apt update
apt install -y docker-ce docker-ce-cli containerd.io
- name: Checkout branch
uses: actions/checkout@v4.1.1
- name: Login to Gitea
uses: docker/login-action@v3
with:
registry: git.toast-server.net
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_TOKEN }}
- name: Build and push image
uses: docker/build-push-action@v5.1.0
with:
context: .
file: Dockerfile
platforms: linux/amd64
push: true
tags: git.toast-server.net/toast/kon:main
cache-from: type=registry,ref=git.toast-server.net/toast/kon:main
cache-to: type=inline