Skip to content

Commit

Permalink
Manual deployments and add git tags
Browse files Browse the repository at this point in the history
  • Loading branch information
Samuel-Therrien-Beslogic committed Dec 4, 2024
1 parent 1b8c3dc commit ef99a68
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 8 deletions.
15 changes: 11 additions & 4 deletions .github/workflows/canopeum_backend_deploy.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
name: canopeum_backend_deploy

on:
workflow_dispatch: # Allows manual builds
push:
branches:
- production
Expand All @@ -18,18 +19,24 @@ jobs:
fail-fast: false
steps:
- uses: actions/checkout@v4
- name: 'login'
uses: docker/login-action@v1
- 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_backend
file: canopeum_backend/Dockerfile
push: true
tags: ghcr.io/beslogic/canopeum_backend:latest
labels: latest
tags: ghcr.io/beslogic/canopeum_backend:latest,ghcr.io/beslogic/canopeum_backend:${{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
15 changes: 11 additions & 4 deletions .github/workflows/canopeum_frontend_deploy.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
name: canopeum_frontend_deploy

on:
workflow_dispatch: # Allows manual builds
push:
branches:
- production
Expand All @@ -21,18 +22,24 @@ jobs:
run: npm ci
- name: Build project
run: npm run build
- name: 'login'
uses: docker/login-action@v1
- 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
labels: latest
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

0 comments on commit ef99a68

Please sign in to comment.