switch to tag-based build

This commit is contained in:
Aine 2024-09-14 21:09:58 +03:00
parent 7de9166648
commit 90a6c7d8c2
No known key found for this signature in database
GPG key ID: 34969C908CCA2804

View file

@ -3,8 +3,6 @@ on:
push: push:
branches: [ "main" ] branches: [ "main" ]
env: env:
upstream_version: v0.10.3
etke_version: etke13
bunny_version: v0.1.0 bunny_version: v0.1.0
base_path: ./ base_path: ./
permissions: permissions:
@ -28,13 +26,14 @@ jobs:
run: yarn install --immutable --network-timeout=300000 run: yarn install --immutable --network-timeout=300000
- name: Set version into manifest.json - name: Set version into manifest.json
run: | run: |
sed -i 's|"icons"|"version": "${{ env.upstream_version }}-${{ env.etke_version }}",\n "icons"|g' public/manifest.json TAG=$(git describe --tags --abbrev=0 || echo "latest")
sed -i "s|\"icons\"|\"version\": \"$TAG\",\\n \"icons\"|g" public/manifest.json
- name: Build - name: Build
run: yarn build --base=${{ env.base_path }} run: yarn build --base=${{ env.base_path }}
- uses: actions/upload-artifact@v4 - uses: actions/upload-artifact@v4
with: with:
path: dist/ path: dist/
name: dist-${{ env.upstream_version }}-${{ env.etke_version }} name: dist
if-no-files-found: error if-no-files-found: error
retention-days: 1 retention-days: 1
compression-level: 0 compression-level: 0
@ -49,7 +48,7 @@ jobs:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- uses: actions/download-artifact@v4 - uses: actions/download-artifact@v4
with: with:
name: dist-${{ env.upstream_version }}-${{ env.etke_version }} name: dist
path: dist/ path: dist/
- name: Set up Docker Buildx - name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1 uses: docker/setup-buildx-action@v1
@ -68,7 +67,7 @@ jobs:
registry.etke.cc/${{ github.repository }} registry.etke.cc/${{ github.repository }}
tags: | tags: |
type=raw,value=latest,enable=${{ github.ref_name == 'main' }} type=raw,value=latest,enable=${{ github.ref_name == 'main' }}
type=raw,value=${{ env.upstream_version }}-${{ env.etke_version }},enable=${{ github.ref_name == 'main' }} type=semver,pattern={{raw}}
- name: Build and push - name: Build and push
uses: docker/build-push-action@v6 uses: docker/build-push-action@v6
with: with:
@ -86,7 +85,7 @@ jobs:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- uses: actions/download-artifact@v4 - uses: actions/download-artifact@v4
with: with:
name: dist-${{ env.upstream_version }}-${{ env.etke_version }} name: dist
path: dist/ path: dist/
- name: Upload - name: Upload
run: | run: |