Skip to content

🚧 Add minimal back-end. #2

🚧 Add minimal back-end.

🚧 Add minimal back-end. #2

name: Build and Push
on:
push:
branches: [main, test]
# Publish semver tags as releases.
tags: ["v*.*.*", "v*.*.*.*"]
env:
REGISTRY: ghcr.io
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Log into registry ${{ env.REGISTRY }}
uses: docker/login-action@v3
with:
registry: ${{ secrets.AZURECR_URL }}
username: ${{ secrets.AZURECR_USERNAME }}
password: ${{ secrets.AZURECR_PASSWORD }}
- name: Generate release tag
id: generate_release_tag
uses: amitsingh-007/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
tag_prefix: "v"
tag_template: "yyyy.mm.dd.i"
- name: Extract Git Commit Hash
id: git_commit_hash
run: echo "commit_hash=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT
- name: Build and push web Docker image
uses: docker/[email protected]
with:
context: .
push: true
tags: ${{ secrets.AZURECR_URL }}/vendor-portal:${{ steps.generate_release_tag.outputs.next_release_tag }} , ${{ secrets.AZURECR_URL }}/vendor-portal:latest
build-args: |
RELEASE_TAG=${{ steps.generate_release_tag.outputs.next_release_tag }}
GIT_COMMIT_HASH=${{ steps.git_commit_hash.outputs.commit_hash }}
- name: Create release
uses: ncipollo/release-action@v1
with:
tag: ${{ steps.generate_release_tag.outputs.next_release_tag }}