Merge pull request #5 from LordMathis/renovate/docker-login-action-di… #23
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: Docker Image CI | |
on: | |
push: | |
branches: [ "main" ] | |
env: | |
REGISTRY: ghcr.io | |
IMAGE_NAME: k9s-web | |
jobs: | |
build: | |
permissions: | |
packages: write | |
contents: read | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4 | |
- name: Set build args env | |
run: | | |
set -a | |
source versions.env | |
set +a | |
echo TTYD_VERSION=$TTYD_VERSION >>${GITHUB_ENV} | |
echo K9S_VERSION=$K9S_VERSION >>${GITHUB_ENV} | |
- name: Log in to the Container registry | |
uses: docker/login-action@5f4866a30a54f16a52d2ecb4a3898e9e424939cf | |
with: | |
registry: ${{ env.REGISTRY }} | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: lowercase repo owner | |
run: | | |
REPO_OWNER=`echo ${{ github.actor }} | tr '[:upper:]' '[:lower:]'` | |
echo REPO_OWNER=$REPO_OWNER >>${GITHUB_ENV} | |
- name: Build and push Docker image | |
uses: docker/build-push-action@eb539f44b153603ccbfbd98e2ab9d4d0dcaf23a4 | |
with: | |
context: . | |
push: true | |
tags: ${{ env.REGISTRY }}/${{ env.REPO_OWNER }}/${{ env.IMAGE_NAME }}:latest | |
build-args: | | |
TTYD_VERSION=${{ env.TTYD_VERSION }} | |
K9S_VERSION=${{ env.K9S_VERSION }} |