Skip to content

fix: update rate

fix: update rate #72

Workflow file for this run

name: CI
on:
workflow_dispatch:
push:
branches:
- main
tags:
- "v*"
env:
IMAGE_NAME: ghcr.io/esc-chula/intania-888-frontend
NEXT_PUBLIC_API_BASE_URL: https://888api.chula.engineering/api/v1
jobs:
build:
name: Build
runs-on: ubuntu-latest
permissions:
contents: write
packages: write
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Log in to the Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ github.token }}
- name: Gather tags name
env:
IMAGE_NAME: ${{ env.IMAGE_NAME }}
SHA: ${{ github.sha }}
REF: ${{ github.ref }}
id: tags
run: |
RESULT="$IMAGE_NAME:latest,$IMAGE_NAME:$SHA"
case "$REF" in
refs/tags/v*)
RESULT="${RESULT},$IMAGE_NAME:${REF#refs/tags/v}"
;;
esac
echo "tags = $RESULT"
echo "tags=$RESULT" >> "$GITHUB_OUTPUT"
- name: Build and Push Docker Image
uses: docker/build-push-action@v3
with:
push: true
tags: ${{ steps.tags.outputs.tags }}
cache-from: type=registry,ref=${{ env.IMAGE_NAME }}:buildcache
cache-to: type=registry,ref=${{ env.IMAGE_NAME }}:buildcache,mode=max
build-args: NEXT_PUBLIC_API_BASE_URL=${{ env.NEXT_PUBLIC_API_BASE_URL }}