From fae5e758de960591c1d773150f427694b23b0815 Mon Sep 17 00:00:00 2001 From: emrah Date: Fri, 24 May 2024 16:27:30 +0300 Subject: [PATCH] chore: add UI workflow --- .github/workflows/jitok-ui.yml | 56 ++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 .github/workflows/jitok-ui.yml diff --git a/.github/workflows/jitok-ui.yml b/.github/workflows/jitok-ui.yml new file mode 100644 index 0000000..18de9b9 --- /dev/null +++ b/.github/workflows/jitok-ui.yml @@ -0,0 +1,56 @@ +name: jitok-ui + +on: + push: + branches: + - "main" + paths: + - ".github/workflows/jitok-ui.yml" + - "ui/**" + +env: + CONTEXT: jitok-ui + MACHINE: ui + REGISTRY: ghcr.io + +jobs: + build: + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + id-token: write + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Custom metadata + run: | + echo "BUILD_DATE=$(date +'%Y%m%d')" >> $GITHUB_ENV + echo ${{ env.REGISTRY }}/${{ github.repository }}/${{ env.CONTEXT }} + + - name: Metadata + uses: docker/metadata-action@v5 + id: meta + with: + images: | + ${{ env.REGISTRY }}/${{ github.repository }}/${{ env.CONTEXT }} + tags: | + type=raw,value=latest + type=raw,value=v${{ env.BUILD_DATE }} + + - name: Login + uses: docker/login-action@v3 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Build and push + uses: docker/build-push-action@v5 + with: + context: ./${{ env.MACHINE }} + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }}