chore: template setup #12
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: 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: | | ||
Check failure on line 25 in .github/workflows/deploy.yaml
|
||
docker build -t app:${{GITHUB_SHA::7}} \ | ||
--build-arg VERSION=${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 |