docker-swiss-army-knife/.forgejo/workflows/kaniko.yaml

32 lines
1,021 B
YAML
Raw Normal View History

2025-04-02 18:46:53 +02:00
name: kaniko
on: push
jobs:
2025-04-02 19:06:54 +02:00
prepare:
runs-on: catthehacker
2025-04-02 18:46:53 +02:00
steps:
2025-04-02 18:59:01 +02:00
- name: Checkout the repo
uses: actions/checkout@v4
2025-04-02 19:18:07 +02:00
- run: echo env.REGISTRY
- run: echo ${{ env.REGISTRY }}
2025-04-02 18:59:01 +02:00
- name: Login to the registry
uses: docker/login-action@v3
2025-04-02 18:46:53 +02:00
with:
2025-04-02 18:59:01 +02:00
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.PACKAGE_TOKEN }}
2025-04-02 19:06:54 +02:00
build:
runs-on: kaniko
steps:
2025-04-02 19:03:29 +02:00
- run: |
mkdir -p /kaniko/.docker
echo "{\"auths\":{\"$CI_REGISTRY\":{\"username\":\"$CI_REGISTRY_USER\",\"password\":\"$CI_REGISTRY_PASSWORD\"}}}" > /kaniko/.docker/config.json
/kaniko/executor --cache=true --context $CI_PROJECT_DIR --dockerfile $CI_PROJECT_DIR/Dockerfile-alpine --destination "$CI_REGISTRY_IMAGE/alpine:$CI_COMMIT_BRANCH"
2025-04-02 18:59:01 +02:00
- name: Build and Pus
uses: docker/build-push-action@v6
2025-04-02 18:46:53 +02:00
with:
push: true
2025-04-02 18:59:01 +02:00
context: swiss-army-knife
file: Dockerfile-alpine