2024-07-26 17:11:57 -03:00
|
|
|
name: Build VMCli with PowerShell
|
|
|
|
on: [push]
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
Build-VMCli:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Install docker
|
|
|
|
run: |
|
|
|
|
apt update
|
|
|
|
apt -y install curl ca-certificates
|
|
|
|
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 update
|
|
|
|
apt -y install docker-ce-cli docker-buildx-plugin docker-compose-plugin
|
|
|
|
|
|
|
|
- name: Clone Repo
|
|
|
|
uses: actions/checkout@v3
|
|
|
|
|
2024-07-26 17:23:17 -03:00
|
|
|
- name: Set up QEMU
|
|
|
|
uses: docker/setup-qemu-action@v3
|
|
|
|
|
2024-07-26 17:17:45 -03:00
|
|
|
- name: Set up Docker Buildx
|
|
|
|
uses: docker/setup-buildx-action@v3
|
|
|
|
|
2024-07-26 18:27:31 -03:00
|
|
|
- name: Cache Docker layers
|
|
|
|
uses: actions/cache@v3
|
|
|
|
with:
|
|
|
|
path: /tmp/.buildx-cache
|
|
|
|
key: ${{ runner.os }}-buildx-${{ github.sha }}
|
|
|
|
restore-keys: |
|
2024-07-26 18:28:25 -03:00
|
|
|
${{ runner.os }}-${{ runner.arch }}-buildx-vmcli
|
2024-07-26 18:27:31 -03:00
|
|
|
|
2024-07-26 17:11:57 -03:00
|
|
|
- name: Login to Docker Hub
|
|
|
|
uses: docker/login-action@v3
|
|
|
|
with:
|
|
|
|
# Someday.... https://github.com/go-gitea/gitea/issues/23642
|
|
|
|
# username: ${{ gitea.repository_owner }}
|
|
|
|
# password: ${{ secrets.GITEA_TOKEN}}
|
|
|
|
username: ${{ vars.PAT_USER }}
|
|
|
|
password: ${{ secrets.PAT_TOKEN}}
|
|
|
|
registry: git.leonardoamaral.com.br
|
2024-07-26 19:34:12 -03:00
|
|
|
|
2024-07-26 17:11:57 -03:00
|
|
|
- name: Build and push
|
2024-07-26 19:34:12 -03:00
|
|
|
uses: int128/kaniko-action@v1
|
2024-07-26 17:11:57 -03:00
|
|
|
with:
|
|
|
|
push: true
|
2024-07-26 18:25:41 -03:00
|
|
|
tags: git.leonardoamaral.com.br/leonardo/vmcli-powershell-container
|
2024-07-26 19:34:12 -03:00
|
|
|
cache: true
|
|
|
|
cache-repository: git.leonardoamaral.com.br/leonardo/vmcli-powershell-container-cache
|
|
|
|
executor: --network webservices gcr.io/kaniko-project/executor:debug
|
|
|
|
|
2024-07-26 17:11:57 -03:00
|
|
|
- name: Move cache
|
|
|
|
run: |
|
|
|
|
rm -rf /tmp/.buildx-cache
|
|
|
|
mv /tmp/.buildx-cache-new /tmp/.buildx-cache
|
|
|
|
|