Merge pull request #10 from axzilla/dev #3
Workflow file for this run
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: Docker Build | |
on: | |
push: | |
branches: | |
- "dev" | |
- "feature/*" | |
tags: | |
- "v*" | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
# Setup Docker Buildx for Multi-Platform-Support | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
# Login to GitHub Container Registry | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
# Generate appropriate tags for different environments (dev, feature branches, releases) | |
- name: Generate Docker metadata | |
id: meta | |
uses: docker/metadata-action@v5 | |
with: | |
images: ghcr.io/axzilla/deeploy | |
tags: | | |
type=ref,event=branch | |
type=semver,pattern={{version}} | |
# Only set 'latest' tag on main branch releases | |
type=raw,value=latest,enable={{is_default_branch}} | |
# Build and push the Docker image with Multi-Platform-Support | |
- name: Build and push | |
uses: docker/build-push-action@v5 | |
with: | |
file: Dockerfile.app | |
platforms: linux/amd64,linux/arm64 | |
push: true | |
tags: ${{ steps.meta.outputs.tags }} |