Skip to content

Fix trigger condition for Docker builds #3

Fix trigger condition for Docker builds

Fix trigger condition for Docker builds #3

Workflow file for this run

name: Build Docker Image
on:
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'
pull_request:
env:
APP: amnezia-xray-core
jobs:
build-image:
runs-on: ubuntu-latest
name: build-image
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Setup metadata
uses: docker/metadata-action@v5
id: metadata
with:
images: amneziavpn/${{ env.APP }}
tags: type=semver,pattern={{version}}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build
uses: docker/build-push-action@v6
env:
DOCKER_BUILD_SUMMARY: false
with:
file: .github/docker/Dockerfile
push: ${{ contains(github.ref, 'refs/tags/') }} # push if tag was set
tags: ${{ steps.metadata.outputs.tags }}