Skip to content

Commit

Permalink
feat: add ci
Browse files Browse the repository at this point in the history
  • Loading branch information
wangyoucao577 committed Sep 30, 2024
1 parent bcfdd0a commit dc8b159
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/build-docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Build Docker

on:
push:
branches: [ "main", "feature/docker" ]
# Publish semver tags as releases.
tags: [ '*.*.*' ]
paths-ignore:
- '**.md'
pull_request:
branches: [ "main" ]

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- id: pre-step
shell: bash
run: echo "image-tag=$(git describe --tags --always)" >> $GITHUB_OUTPUT
- name: Build & Publish Docker Image
uses: elgohr/Publish-Docker-Github-Action@v5
with:
name: ${{ github.repository }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
registry: ghcr.io
tags: "${{ github.ref == 'refs/heads/main' && 'latest,' || '' }}${{ steps.pre-step.outputs.image-tag }}"
no_push: ${{ github.event_name == 'pull_request' }}

0 comments on commit dc8b159

Please sign in to comment.