Skip to content

chore: template setup #10

chore: template setup

chore: template setup #10

Workflow file for this run

name: Deploy
on:
push:
branches:
- main
workflow_dispatch:
jobs:
build:
name: "Build and Push Image"
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Get Short Commit Hash
id: vars
shell: bash
run: |
echo "VERSION=$(git rev-parse --short HEAD)" >> $GITHUB_ENV
echo Build Version: $VERSION
- name: Build Image
run: |
docker build . \
--build-arg VERSION=${GITHUB_SHA::7} \
-t app:${GITHUB_SHA::7}
# Upload Docker image Artifact
# NOTE: This is only for template purposes. You should be pushing the image to an image registry/repository.
# When you use this template, make sure to replace this step with the appropriate step to push the image to your
# image registry/repository.
- name: Upload Docker Image Artifact
uses: actions/upload-artifact@v3
with:
name: app_${GITHUB_SHA::7}
path: app_${GITHUB_SHA::7}.tar