Release #75
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: | |
workflow_dispatch: | |
permissions: | |
contents: write | |
packages: write | |
jobs: | |
release: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- run: git fetch --force --tags | |
- name: Set outputs | |
id: vars | |
run: echo "::set-output name=latest_tag::$(git describe --tags --abbrev=0)" | |
- name: Check outputs | |
run: echo ${{ steps.vars.outputs.latest_tag }} | |
- name: find and replace metlcd version in frontend | |
uses: jacobtomlinson/gha-find-replace@v3 | |
with: | |
find: "dev" | |
replace: "${{ steps.vars.outputs.latest_tag }}" | |
include: "ui/src/version.ts" | |
regex: true | |
- uses: pnpm/action-setup@v2 | |
with: | |
version: 8 | |
- name: build frontend | |
run: | | |
pnpm --prefix=./ui install | |
pnpm --prefix=./ui build --emptyOutDir | |
- uses: actions/setup-go@v4 | |
with: | |
go-version: stable | |
- uses: goreleaser/goreleaser-action@v5 | |
with: | |
distribution: goreleaser | |
version: latest | |
args: release --clean --skip=validate | |
env: | |
GITHUB_TOKEN: ${{ secrets.GHCR_TOKEN }} | |
- name: build docker image | |
run: | | |
docker build -t meltred/meltcd:${{ steps.vars.outputs.latest_tag }} . | |
- name: push docker image | |
run: | | |
echo ${{ secrets.DOCKER_HUB }} | docker login -u "meltred" --password-stdin | |
docker push meltred/meltcd:${{ steps.vars.outputs.latest_tag }} | |
docker image tag meltred/meltcd:${{ steps.vars.outputs.latest_tag }} meltred/meltcd:latest | |
docker push meltred/meltcd:latest | |
docker logout | |
echo ${{ secrets.GHCR_TOKEN }} | docker login ghcr.io -u "kunalsin9h" --password-stdin | |
docker image tag meltred/meltcd:latest ghcr.io/meltred/meltcd:${{ steps.vars.outputs.latest_tag }} | |
docker push ghcr.io/meltred/meltcd:${{ steps.vars.outputs.latest_tag }} | |
docker image tag ghcr.io/meltred/meltcd:${{ steps.vars.outputs.latest_tag }} ghcr.io/meltred/meltcd:latest | |
docker push ghcr.io/meltred/meltcd:latest |