name: Docker Build & Push on: push: tags: - 'v*' workflow_dispatch: inputs: api_url: description: 'API URL' required: false default: 'http://ut.khoavo.myds.me:8981/api' type: string jobs: build: runs-on: ubuntu-latest permissions: contents: read packages: write steps: - name: Checkout repository uses: actions/checkout@v4 - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 - name: Log into Forgejo Registry uses: docker/login-action@v3 with: registry: git.khoavo.myds.me username: ${{ secrets.FORGEJO_USERNAME }} password: ${{ secrets.FORGEJO_PASSWORD }} - name: Extract metadata id: meta uses: docker/metadata-action@v5 with: images: git.khoavo.myds.me/vndangkhoa/kv-tube tags: | type=semver,pattern={{version}} type=raw,value=latest,enable=${{ github.ref == 'refs/tags/v*' }} - name: Build and push uses: docker/build-push-action@v5 with: context: . push: true tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} platforms: linux/amd64 cache-from: type=gha cache-to: type=gha,mode=max build-args: | NEXT_PUBLIC_API_URL=${{ github.event.inputs.api_url || 'http://ut.khoavo.myds.me:8981/api' }}