Export env vars #10
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@v4 | |
- name: Set build args env | |
run: | | |
set -a | |
source versions.env | |
set +a | |
echo $TTYD_VERSION | |
echo $K9S_VERSION | |
echo TTYD_VESION=$TTYD_VERSION >>${GITHUB_ENV} | |
echo K9S_VERSION=$K9S_VERSION >>${GITHUB_ENV} | |
- name: Log in to the Container registry | |
uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1 | |
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 | |
echo REPO_OWNER=$REPO_OWNER >>${GITHUB_ENV} | |
- name: Build and push Docker image | |
uses: docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4 | |
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 }} |