Prepare release 0.8.0 #19
Workflow file for this run
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: Build and deploy web | |
on: | |
workflow_dispatch: | |
push: | |
tags: | |
- 'v*.*.*\+*' | |
jobs: | |
extract-version: | |
name: Determine version | |
runs-on: ubuntu-latest | |
outputs: | |
tag: ${{ steps.extract-version.outputs.tag }} | |
dockertag: ${{ steps.extract-version.outputs.dockertag }} # "+" in the tag is misinterpreted by the docker registry | |
isAlpha: ${{ steps.extract-version.outputs.isAlpha }} | |
versionCode: ${{ steps.extract-version.outputs.versionCode }} | |
versionName: ${{ steps.extract-version.outputs.versionName }} | |
steps: | |
- name: Determine version | |
id: extract-version | |
run: | | |
tag=${GITHUB_REF#refs/*/} | |
[[ $tag == *'-alpha' ]] && isAlpha=true || isAlpha=false; | |
versionCode=${tag##*+} | |
versionCode=${versionCode%-*} | |
versionName=${tag%+*} | |
versionName=${versionName#v} | |
dockertag=${tag/+/-} | |
echo tag=$tag >> $GITHUB_OUTPUT | |
echo isAlpha=$isAlpha >> $GITHUB_OUTPUT | |
echo versionCode=$versionCode >> $GITHUB_OUTPUT | |
echo versionName=$versionName >> $GITHUB_OUTPUT | |
echo dockertag=$dockertag >> $GITHUB_OUTPUT | |
build-and-deploy: | |
name: Release Titan ${{ needs.extract-version.outputs.tag }} Web | |
runs-on: ubuntu-latest | |
needs: [extract-version] | |
steps: | |
- name: Checkout 🛎️ | |
uses: actions/checkout@v4 | |
- name: Setup Flutter SDK | |
uses: subosito/flutter-action@v2 | |
with: | |
channel: 'stable' | |
flutter-version: '3.19.1' | |
cache: true | |
- name: Cleanup 🧹 | |
run: flutter clean | |
- name: Get Packages | |
run: flutter pub get | |
- name: Configure Alpha env | |
if: needs.extract-version.outputs.isAlpha == 'true' | |
run: | | |
echo THE_MOVIE_DB_API=$THE_MOVIE_DB_API >> .env | |
echo ALPHA_HOST=$ALPHA_HOST >> .env | |
echo PLAUSIBLE_HOST=$PLAUSIBLE_HOST >> .env | |
echo PLAUSIBLE_DOMAIN=$PLAUSIBLE_DOMAIN >> .env | |
env: | |
THE_MOVIE_DB_API: ${{ secrets.THE_MOVIE_DB_API }} | |
ALPHA_HOST: ${{ vars.ALPHA_HOST }} | |
PLAUSIBLE_HOST: ${{ secrets.PLAUSIBLE_ALPHA_HOST }} | |
PLAUSIBLE_DOMAIN: ${{ secrets.PLAUSIBLE_ALPHA_DOMAIN }} | |
- name: Configure production env | |
if: needs.extract-version.outputs.isAlpha == 'false' | |
run: | | |
echo THE_MOVIE_DB_API=$THE_MOVIE_DB_API >> .env | |
echo PROD_HOST=$PROD_HOST >> .env | |
echo PLAUSIBLE_HOST=$PLAUSIBLE_HOST >> .env | |
echo PLAUSIBLE_DOMAIN=$PLAUSIBLE_DOMAIN >> .env | |
env: | |
THE_MOVIE_DB_API: ${{ secrets.THE_MOVIE_DB_API }} | |
PROD_HOST: ${{ vars.PROD_HOST }} | |
PLAUSIBLE_HOST: ${{ secrets.PLAUSIBLE_HOST }} | |
PLAUSIBLE_DOMAIN: ${{ secrets.PLAUSIBLE_DOMAIN }} | |
- name: Set Alpha icons | |
if: needs.extract-version.outputs.isAlpha == 'true' | |
run: | | |
cp -f web/Alpha/favicon.png web/favicon.png | |
cp -f web/Alpha/icons/* web/icons/ | |
- name: Set production icons | |
if: needs.extract-version.outputs.isAlpha == 'false' | |
run: | | |
cp -f web/Prod/favicon.png web/favicon.png | |
cp -f web/Prod/icons/* web/icons/ | |
- name: Build 🔧 | |
run: flutter build web --release | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Login to Docker Registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ${{ secrets.DOCKER_REGISTRY_URL }} | |
username: ${{ secrets.DOCKER_REGISTRY_USERNAME }} | |
password: ${{ secrets.DOCKER_REGISTRY_PASSWORD }} | |
- name: Build and push | |
uses: docker/build-push-action@v5 | |
with: | |
context: . | |
platforms: linux/amd64 | |
push: true | |
tags: | | |
${{ secrets.DOCKER_REGISTRY_IDENTIFER }}/titan:${{ needs.extract-version.outputs.dockertag }} |