bump Kaniko to v1.20.0 #7
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build and Release | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
release: | |
runs-on: ubuntu-latest | |
permissions: | |
packages: write | |
contents: write | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- id: version | |
name: Generate version number | |
run: | | |
TIMESTAMP=$(TZ=UTC git show -s --format="%cd" --date=format-local:"%Y-%m-%dT%H:%M:%S") | |
VERSION=$(echo $TIMESTAMP | sed -E 's/^[0-9]{2}([0-9]{2})-0*([0-9]+)-([0-9]+)T0*([0-9]*):([0-9]{2}).*/\1.\2\3.\4\5/') | |
echo "VERSION=${VERSION}" >> "$GITHUB_OUTPUT" | |
- name: Build image | |
run: | | |
docker build . -t ghcr.io/signal24/kaniko-tools:${{ steps.version.outputs.VERSION }} | |
- name: Log in to registry | |
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u $ --password-stdin | |
- name: Push image | |
run: | | |
docker push ghcr.io/signal24/kaniko-tools:${{ steps.version.outputs.VERSION }} | |
docker tag ghcr.io/signal24/kaniko-tools:${{ steps.version.outputs.VERSION }} ghcr.io/signal24/kaniko-tools:latest | |
docker push ghcr.io/signal24/kaniko-tools:latest | |
- name: Create Release | |
id: create-release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: v${{ steps.version.outputs.VERSION }} | |
release_name: v${{ steps.version.outputs.VERSION }} | |
body: ' ' |