Skip to content

Commit

Permalink
updated CI to build server UI
Browse files Browse the repository at this point in the history
  • Loading branch information
yjpictures committed Oct 4, 2023
1 parent 2380484 commit ef4e1b8
Showing 1 changed file with 54 additions and 44 deletions.
98 changes: 54 additions & 44 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
name: Docker Image Build and Deploy

on:
push:
branches:
- main
push
# branches:
# - main

jobs:

Expand All @@ -20,49 +20,59 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Log into registry GitHub Container Registry
uses: docker/login-action@v3
- name: Setup Node.js
uses: actions/setup-node@v3
with:
registry: ${{ vars.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
node-version: ${{ vars.NODE_VERSION }}

- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build Server UI
run: |
cd ./server-ui
npm run build
# - name: Set up Docker Buildx
# uses: docker/setup-buildx-action@v3

# - name: Log into registry GitHub Container Registry
# uses: docker/login-action@v3
# with:
# registry: ${{ vars.REGISTRY }}
# username: ${{ github.actor }}
# password: ${{ secrets.GITHUB_TOKEN }}

# - name: Login to Docker Hub
# uses: docker/login-action@v3
# with:
# username: ${{ secrets.DOCKERHUB_USERNAME }}
# password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Docker Metadata Capture
id: meta
uses: docker/metadata-action@v5
with:
context: git
images: |
${{ vars.REGISTRY }}/${{ github.repository }}
${{ github.repository }}
tags: |
type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', 'main') }}
type=sha
# - name: Docker Metadata Capture
# id: meta
# uses: docker/metadata-action@v5
# with:
# context: git
# images: |
# ${{ vars.REGISTRY }}/${{ github.repository }}
# ${{ github.repository }}
# tags: |
# type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', 'main') }}
# type=sha

- name: Build and push
uses: docker/build-push-action@v5
with:
context: .
file: ${{ vars.DOCKERFILE_PROD }}
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: |
"org.opencontainers.image.description=${{ vars.GHCR_DESCRIPTION }}"
provenance: false
# - name: Build and push
# uses: docker/build-push-action@v5
# with:
# context: .
# file: ${{ vars.DOCKERFILE_PROD }}
# push: true
# tags: ${{ steps.meta.outputs.tags }}
# labels: |
# "org.opencontainers.image.description=${{ vars.GHCR_DESCRIPTION }}"
# provenance: false

- name: Docker Hub Description
uses: peter-evans/dockerhub-description@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
repository: ${{ github.repository }}
short-description: ${{ vars.DOCKER_HUB_DESCRIPTION }}
# - name: Docker Hub Description
# uses: peter-evans/dockerhub-description@v3
# with:
# username: ${{ secrets.DOCKERHUB_USERNAME }}
# password: ${{ secrets.DOCKERHUB_TOKEN }}
# repository: ${{ github.repository }}
# short-description: ${{ vars.DOCKER_HUB_DESCRIPTION }}

0 comments on commit ef4e1b8

Please sign in to comment.