-
Notifications
You must be signed in to change notification settings - Fork 14
45 lines (43 loc) · 1.3 KB
/
canopeum_frontend_deploy.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
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@v1
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@v3
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