ts-activity/.github/workflows/release.yml
2023-07-21 23:29:25 -04:00

55 lines
1.7 KiB
YAML

name: release
on:
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'
jobs:
build-release:
name: build-release
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
fetch-depth: 1
- name: Log in to Docker Hub
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
with:
images: aramperes/ts-activity
- name: Build and push Docker image
uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
- name: Get the release version from the tag
if: env.VERSION == ''
run: |
echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
echo "version is: ${{ env.VERSION }}"
- name: Update Helm chart version
shell: bash
run: |
v="$(echo '${{ env.VERSION }}' | cut -d 'v' -f2)"
sed -i "s/0\.0\.0/$v/g" helm/ts-activity/Chart.yaml
- name: Build and push Helm chart
uses: goodsmileduck/helm-push-action@ec9f29cbf16a4773438b3ea98790aa5b5ca3e749
env:
SOURCE_DIR: './helm'
CHART_FOLDER: 'ts-activity'
CHARTMUSEUM_URL: 'https://charts.momoperes.ca'
CHARTMUSEUM_USER: '${{ secrets.CHARTMUSEUM_USER }}'
CHARTMUSEUM_PASSWORD: ${{ secrets.CHARTMUSEUM_PASSWORD }}