Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 19 additions & 8 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [ 18.x, 20.x ] # Removed outdated Node.js versions and kept stable ones for Angular 19 compatibility.
node-version: [ 18.x, 19.x 20.x, 21.x, 22.x] # Removed outdated Node.js versions and kept stable ones for Angular 19 compatibility.

timeout-minutes: 03 # Set a timeout of 30 minutes for the build job

Expand Down Expand Up @@ -43,7 +43,7 @@ jobs:
timeout-minutes: 03 # Set a timeout of 30 minutes for the deploy job

steps:
- name: Checkout repository
- name: Checkout code
uses: actions/checkout@v3

- name: Log in to Docker Hub
Expand All @@ -52,9 +52,20 @@ jobs:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Build and push Docker image
uses: docker/build-push-action@v4
with:
context: .
push: true
tags: ${{ secrets.DOCKER_USERNAME }}/wordpresenter:latest # Updated Docker image name
- name: Extract Git metadata
id: vars
run: |
echo "BRANCH_NAME=${GITHUB_REF#refs/heads/}" >> $GITHUB_ENV
echo "COMMIT_SHA=${GITHUB_SHA::7}" >> $GITHUB_ENV

- name: Build Docker image
run: docker build -t teclit/wordpresenter:${{ env.BRANCH_NAME }}-${{ env.COMMIT_SHA }} .

- name: Tag Docker image as latest
run: docker tag teclit/wordpresenter:${{ env.BRANCH_NAME }}-${{ env.COMMIT_SHA }} teclit/wordpresenter:latest

- name: Push Docker image to Docker Hub with dynamic tag
run: docker push teclit/wordpresenter:${{ env.BRANCH_NAME }}-${{ env.COMMIT_SHA }}

- name: Push Docker image to Docker Hub with latest tag
run: docker push teclit/wordpresenter:latest