fix: build fail #38
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: Release on push to main | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
release: | |
name: "Release" | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ ubuntu-latest ] | |
steps: | |
- uses: actions/checkout@v3 | |
# versioning | |
- name: Calculate release version | |
run: | | |
echo "release_version=1.$(date +'%g%m%d%H%M').0" >> $GITHUB_ENV | |
- name: Set version | |
run: | | |
git tag v${{ env.release_version }} | |
git push --tags | |
# bun setup and build | |
- name: Setup bun 🏗 | |
uses: oven-sh/setup-bun@v1 | |
# with: | |
# version: "canary" | |
- name: Install dependencies 👨🏻💻 | |
run: bun install | |
- name: Build | |
run: bun run build | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
# docker build and push | |
- name: Login to Docker Hub | |
uses: docker/login-action@v2 | |
with: | |
username: ${{secrets.DOCKER_USERNAME}} | |
password: ${{secrets.DOCKER_PASSWORD}} | |
- name: Build and push | |
uses: docker/build-push-action@v4 | |
with: | |
push: true | |
tags: waltid/vc-repository:latest, waltid/vc-repository:${{ env.release_version }} | |
# changelog | |
- name: Changelog | |
uses: ardalanamini/auto-changelog@v3 | |
id: changelog | |
with: | |
github-token: ${{ github.token }} | |
commit-types: | | |
breaking: Breaking Changes | |
feat: New Features | |
fix: Bug Fixes | |
revert: Reverts | |
perf: Performance Improvements | |
refactor: Refactors | |
deps: Dependencies | |
docs: Documentation Changes | |
style: Code Style Changes | |
build: Build System | |
ci: Continuous Integration | |
test: Tests | |
chore: Chores | |
other: Other Changes | |
default-commit-type: Other Changes | |
release-name: v${{ env.release_version }} | |
mention-authors: true | |
mention-new-contributors: true | |
include-compare: true | |
semver: true | |
- name: Create Release | |
uses: softprops/action-gh-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: v${{ env.release_version }} | |
body: | | |
${{ steps.changelog.outputs.changelog }} | |
prerelease: ${{ steps.changelog.outputs.prerelease }} | |
- name: Prepare CD | |
run: sed "s/_DEFAULT_DEPLOYMENT_/$GITHUB_SHA/g" k8s/deployment-prod.yaml > k8s/deployment_mod.yaml | |
- name: Continuous deployment | |
uses: actions-hub/kubectl@master | |
env: | |
KUBE_CONFIG: ${{ secrets.KUBE_CONFIG }} | |
with: | |
args: apply -n default -f k8s/deployment_mod.yaml |