Another try to fix version #25
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
on: | |
push: | |
branches: | |
- main | |
jobs: | |
release: | |
name: release | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
packages: write | |
steps: | |
# Checkout code | |
- uses: actions/checkout@v3 | |
# Set version environment | |
- name: Set VERSION | |
run: echo "VERSION=`echo $GITHUB_REF|IFS=\"/\" read foo foo version; echo $version`" >> $GITHUB_ENV | |
# Build web ui | |
- name: Use Node.js 20.x | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 20.x | |
- run: npm install | |
working-directory: ./web/ui | |
- run: npm run build | |
working-directory: ./web/ui | |
# Build docker image | |
- uses: ko-build/[email protected] | |
- run: GOFLAGS="-ldflags=-X=main.version=$VERSION" ko build -B --platform all --sbom none ./cmd/ybfeed | |
env: | |
KO_DOCKER_REPO: ghcr.io/ybizeul |