publish step
This commit is contained in:
parent
becffc8cbd
commit
07c8d95cf4
1 changed files with 19 additions and 15 deletions
|
|
@ -1,23 +1,27 @@
|
||||||
name: kaniko
|
name: kaniko
|
||||||
|
|
||||||
on: push
|
on: push
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
deploy:
|
build:
|
||||||
runs-on: ubuntu-rolling
|
runs-on: kaniko
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- name: Checkout the repo
|
||||||
- uses: docker/metadata-action@v4
|
uses: actions/checkout@v4
|
||||||
id: metadata
|
- name: Login to the registry
|
||||||
|
uses: docker/login-action@v3
|
||||||
with:
|
with:
|
||||||
images: ${{ steps.ecr.outputs.registry }}/${{ github.repository }}
|
registry: ${{ env.REGISTRY }}
|
||||||
- uses: int128/kaniko-action@v1
|
username: ${{ github.actor }}
|
||||||
id: build
|
password: ${{ secrets.PACKAGE_TOKEN }}
|
||||||
|
- 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"
|
||||||
|
|
||||||
|
- name: Build and Pus
|
||||||
|
uses: docker/build-push-action@v6
|
||||||
with:
|
with:
|
||||||
push: true
|
push: true
|
||||||
tags: ${{ steps.metadata.outputs.tags }}
|
context: swiss-army-knife
|
||||||
labels: ${{ steps.metadata.outputs.labels }}
|
file: Dockerfile-alpine
|
||||||
cache: true
|
|
||||||
cache-repository: ${{ steps.ecr.outputs.registry }}/${{ github.repository }}/cache
|
|
||||||
- run: kustomize edit set image myapp=${{ steps.ecr.outputs.registry }}/${{ github.repository }}@${{ steps.build.outputs.digest }}
|
|
||||||
- run: kustomize build | kubectl apply -f -
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue