canopeum_frontend_deploy #94
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: canopeum_frontend_deploy | |
on: | |
workflow_dispatch: # Allows manual builds | |
push: | |
branches: | |
- production | |
paths: | |
- "canopeum_frontend/**" | |
- ".github/workflows/canopeum_frontend_deploy.yml" | |
jobs: | |
Build: | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
working-directory: canopeum_frontend | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
- name: Install dependencies | |
run: npm ci | |
- name: Build project | |
run: npm run build | |
- uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Get datetime | |
id: datetime | |
run: echo DATETIME=$(date +'%Y-%m-%d-%H-%M') >> $GITHUB_OUTPUT | |
- name: Publish Docker image | |
id: push | |
uses: docker/build-push-action@v6 | |
with: | |
context: ./canopeum_frontend | |
file: canopeum_frontend/Dockerfile | |
push: true | |
tags: ghcr.io/beslogic/canopeum_frontend:latest,ghcr.io/beslogic/canopeum_frontend:${{steps.datetime.outputs.DATETIME}} | |
- name: Create and push git tag | |
continue-on-error: true | |
run: | | |
git tag ${{steps.datetime.outputs.DATETIME}} | |
git push origin --tags |