Use run keyword instead
This commit is contained in:
@ -3,35 +3,41 @@ on:
|
|||||||
push:
|
push:
|
||||||
# Only run when the Dockerfile changes
|
# Only run when the Dockerfile changes
|
||||||
paths:
|
paths:
|
||||||
- 'Dockerfile'
|
- "Dockerfile"
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-and-push:
|
build-and-push:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
container:
|
||||||
|
image: quay.io/buildah/stable
|
||||||
|
options: --privileged
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
- name: Build and Push
|
- name: Build and Push
|
||||||
uses: docker://quay.io/buildah/stable
|
|
||||||
env:
|
env:
|
||||||
USERNAME: ${{ gitea.actor }}
|
USERNAME: ${{ gitea.actor }}
|
||||||
PASSWORD: ${{ secrets.USER_PACKAGE_PASSWORD }}
|
PASSWORD: ${{ secrets.USER_PACKAGE_PASSWORD }}
|
||||||
REGISTRY: gitea.212.63.210.91.nip.io
|
REGISTRY: gitea.212.63.210.91.nip.io
|
||||||
# Changed to repository_owner to avoid 'owner/repo/image' nesting
|
|
||||||
IMAGE: ${{ gitea.repository_owner }}/godot-builder
|
IMAGE: ${{ gitea.repository_owner }}/godot-builder
|
||||||
TAG: ${{ gitea.sha }}
|
TAG: ${{ gitea.sha }}
|
||||||
with:
|
run: |
|
||||||
entrypoint: /bin/sh
|
# 1. Login to the registry
|
||||||
args: -c "
|
# We use --tls-verify=false for your internal Traefik certs
|
||||||
buildah login -u $USERNAME -p $PASSWORD --tls-verify=false --storage-driver=vfs $REGISTRY &&
|
buildah login -u $USERNAME -p $PASSWORD --tls-verify=false --storage-driver=vfs $REGISTRY
|
||||||
|
|
||||||
# Build the image (assuming file is named 'Dockerfile' in root)
|
|
||||||
buildah build --tls-verify=false --storage-driver=vfs -t $REGISTRY/$IMAGE:$TAG -t $REGISTRY/$IMAGE:latest . &&
|
|
||||||
|
|
||||||
# Push the specific SHA tag
|
|
||||||
buildah push --tls-verify=false --storage-driver=vfs $REGISTRY/$IMAGE:$TAG &&
|
|
||||||
|
|
||||||
# Push the 'latest' tag
|
# 2. Build the image
|
||||||
buildah push --tls-verify=false --storage-driver=vfs $REGISTRY/$IMAGE:latest
|
# Using the 'vfs' driver is slower but more stable for nested containers
|
||||||
"
|
buildah build \
|
||||||
|
--tls-verify=false \
|
||||||
|
--storage-driver=vfs \
|
||||||
|
-f Dockerfile \
|
||||||
|
-t $REGISTRY/$IMAGE:$TAG \
|
||||||
|
-t $REGISTRY/$IMAGE:latest \
|
||||||
|
.
|
||||||
|
|
||||||
|
# 3. Push the tags
|
||||||
|
buildah push --tls-verify=false --storage-driver=vfs $REGISTRY/$IMAGE:$TAG
|
||||||
|
buildah push --tls-verify=false --storage-driver=vfs $REGISTRY/$IMAGE:latest
|
||||||
|
|||||||
Reference in New Issue
Block a user