Skip to content

feat: github workflows - automatic CI/CD, versions #1

feat: github workflows - automatic CI/CD, versions

feat: github workflows - automatic CI/CD, versions #1

Workflow file for this run

name: Build and Push Docker Image (prod)
on:
push:
branches:
- main
tags:
- 'v*'
jobs:
build-and-push:
runs-on: ubuntu-24.04
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
platforms: linux/amd64,linux/arm64
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PAT }}
- name: Extract commit hash as tag
run: |
VERSION=$(git rev-parse --short HEAD)
echo "VERSION=$VERSION" >> $GITHUB_ENV
- name: Build and push image
id: push
uses: docker/build-push-action@v6
with:
context: .
push: false
tags: |
haniel56/qwynk:${{ env.VERSION }}
haniel56/qwynk:latest
platforms: linux/amd64,linux/arm64