canopeum_backend_deploy #151
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_backend_deploy | |
on: | |
workflow_dispatch: # Allows manual builds | |
push: | |
branches: | |
- production | |
paths: | |
- "canopeum_backend/**" | |
- ".github/workflows/canopeum_backend_deploy.yml" | |
jobs: | |
Build: | |
runs-on: "ubuntu-latest" | |
defaults: | |
run: | |
working-directory: canopeum_backend | |
strategy: | |
fail-fast: false | |
steps: | |
- uses: actions/checkout@v4 | |
- 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_backend | |
file: canopeum_backend/Dockerfile | |
push: true | |
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 |