Initial Release
Some checks failed
Build VMCli with PowerShell / Build-VMCli (push) Failing after 1m48s
Some checks failed
Build VMCli with PowerShell / Build-VMCli (push) Failing after 1m48s
Signed-off-by: Leonardo Amaral <contato@leonardoamaral.com.br>
This commit is contained in:
commit
d93a87489d
50
.gitea/workflows/build-and-push.yaml
Normal file
50
.gitea/workflows/build-and-push.yaml
Normal file
@ -0,0 +1,50 @@
|
||||
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
|
||||
|
||||
- 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
|
||||
|
||||
- name: Build and push
|
||||
uses: docker/build-push-action@v5
|
||||
with:
|
||||
cache-from: type=local,src=/tmp/.buildx-cache
|
||||
cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max
|
||||
context: .
|
||||
file: ./Containerfile
|
||||
platforms: linux/amd64, linux/arm64
|
||||
push: true
|
||||
tags: leonardo/vmcli-powershell-container
|
||||
|
||||
- name: Move cache
|
||||
run: |
|
||||
rm -rf /tmp/.buildx-cache
|
||||
mv /tmp/.buildx-cache-new /tmp/.buildx-cache
|
||||
|
4
Containerfile
Normal file
4
Containerfile
Normal file
@ -0,0 +1,4 @@
|
||||
FROM mcr.microsoft.com/powershell:latest
|
||||
|
||||
RUN /opt/microsoft/powershell/7/pwsh -Command Set-PSRepository -Name 'PSGallery' -Verbose -InstallationPolicy Trusted \
|
||||
&& /opt/microsoft/powershell/7/pwsh -Command Install-Module VMware.PowerCLI -Verbose -Scope AllUsers -AllowClobber -AcceptLicense -Confirm:\$false
|
Loading…
Reference in New Issue
Block a user