add: auto build a workload-identity container

This commit is contained in:
Raymond Kao 2023-05-19 02:55:46 +00:00
Родитель ecf57ed1fe
Коммит 51cb1ee57e
1 изменённых файлов: 39 добавлений и 0 удалений

39
.github/workflows/workload-identity-container.yaml поставляемый Normal file
Просмотреть файл

@ -0,0 +1,39 @@
name: Workload Identity Build and Push to GHCR
on:
push:
branches:
- main
paths:
- 'docs/cheatsheets/workload-identity-app/**'
workflow_dispatch:
env:
REGISTRY: ghcr.io
REPOSITORY: ${{ github.repository }}
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Login to GHCR
uses: docker/login-action@v1
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: downcase env.REPOSITORY
run: |
echo "REPOSITORY=${GITHUB_REPOSITORY,,}" >>${GITHUB_ENV}
- name: Build and push Docker image
uses: docker/build-push-action@v2
with:
context: docs/cheatsheets/workload-identity-app
push: true
tags: ${{ env.REGISTRY }}/${{ env.REPOSITORY }}/workload-identity-app:latest