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
|
||||
|
||||
on: push
|
||||
|
||||
jobs:
|
||||
deploy:
|
||||
runs-on: ubuntu-rolling
|
||||
build:
|
||||
runs-on: kaniko
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: docker/metadata-action@v4
|
||||
id: metadata
|
||||
- name: Checkout the repo
|
||||
uses: actions/checkout@v4
|
||||
- name: Login to the registry
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
images: ${{ steps.ecr.outputs.registry }}/${{ github.repository }}
|
||||
- uses: int128/kaniko-action@v1
|
||||
id: build
|
||||
registry: ${{ env.REGISTRY }}
|
||||
username: ${{ github.actor }}
|
||||
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:
|
||||
push: true
|
||||
tags: ${{ steps.metadata.outputs.tags }}
|
||||
labels: ${{ steps.metadata.outputs.labels }}
|
||||
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 -
|
||||
context: swiss-army-knife
|
||||
file: Dockerfile-alpine
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue