40 lines
1.3 KiB
YAML
40 lines
1.3 KiB
YAML
name: ci
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- 'main'
|
|
|
|
jobs:
|
|
docker:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
|
|
|
|
# INSTALL docker
|
|
- run: apt-get update
|
|
- run: apt-get install ca-certificates curl gnupg
|
|
- run: install -m 0755 -d /etc/apt/keyrings
|
|
- run: curl -fsSL https://download.docker.com/linux/debian/gpg | gpg --dearmor -o /etc/apt/keyrings/docker.gpg
|
|
- run: chmod a+r /etc/apt/keyrings/docker.gpg
|
|
- run: echo "deb [arch="$(dpkg --print-architecture)" signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/debian "$(. /etc/os-release && echo "$VERSION_CODENAME")" stable" | tee /etc/apt/sources.list.d/docker.list > /dev/null
|
|
- run: apt-get update
|
|
- run: apt-get -y install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
|
|
|
|
|
|
|
|
- name: Set up QEMU
|
|
uses: docker/setup-qemu-action@v3
|
|
- name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v3
|
|
- name: Login to Docker private registry
|
|
uses: docker/login-action@v3
|
|
with:
|
|
registry: ${{ vars.REGISTRY_DOCKER }}
|
|
username: ${{ secrets.REGISTRY_DOCKER_USER }}
|
|
password: ${{ secrets.REGISTRY_DOCKER_PASS }}
|
|
- name: Build and push
|
|
uses: docker/build-push-action@v5
|
|
with:
|
|
push: true
|
|
tags: user/app:latest |