Publish 0.7.0+100 #14
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.13' | |
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 DEBUG_HOST=$DEBUG_HOST >> .env | |
echo RELEASE_HOST=$DEBUG_HOST >> .env | |
env: | |
THE_MOVIE_DB_API: ${{ secrets.THE_MOVIE_DB_API }} | |
DEBUG_HOST: ${{ secrets.DEBUG_HOST }} | |
- name: Configure production env | |
if: needs.extract-version.outputs.isAlpha == 'false' | |
run: | | |
echo THE_MOVIE_DB_API=$THE_MOVIE_DB_API >> .env | |
echo DEBUG_HOST=$DEBUG_HOST >> .env | |
echo RELEASE_HOST=$RELEASE_HOST >> .env | |
env: | |
THE_MOVIE_DB_API: ${{ secrets.THE_MOVIE_DB_API }} | |
DEBUG_HOST: ${{ secrets.DEBUG_HOST }} | |
RELEASE_HOST: ${{ secrets.RELEASE_HOST }} | |
- name: Set Alpha icons | |
if: needs.extract-version.outputs.isAlpha == 'true' | |
run: | | |
rm assets/images/icon.png | |
mv assets/images/icon_alpha.png assets/images/icon.png | |
rm assets/images/logo.png | |
mv assets/images/logo_alpha.png assets/images/logo.png | |
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 }} |