fix version and token
This commit is contained in:
@@ -15,15 +15,14 @@ jobs:
|
|||||||
id: generate_tag
|
id: generate_tag
|
||||||
run: |
|
run: |
|
||||||
echo "Generating a unique tag for the image..."
|
echo "Generating a unique tag for the image..."
|
||||||
echo " Repo: ${{ github.repository }}; Run ID: ${{ github.run_id }}"
|
echo "Repo: ${{ github.repository }}; Run ID: ${{ github.run_id }}"
|
||||||
PREFIX="gitea.controller.bittehackmichnicht.de/${{ github.repository }}/ptp-chat-frontend"
|
PREFIX="gitea.controller.bittehackmichnicht.de/${{ github.repository }}/ptp-chat-frontend"
|
||||||
if [ "${{ github.event_name }}" = "schedule" ]; then
|
if [ "${{ github.event_name }}" = "schedule" ]; then
|
||||||
echo "Scheduled run detected, using date-based tag."
|
echo "Scheduled run detected, using date-based tag."
|
||||||
echo "VERSION=1.0.0-${{ github.run_id }}" >> $GITHUB_OUTPUT
|
VERSION="1.0.0-${{ github.run_id }}"
|
||||||
echo "TAG=$PREFIX:$VERSION" >> $GITHUB_OUTPUT
|
|
||||||
echo "LATEST=true" >> $GITHUB_OUTPUT
|
echo "LATEST=true" >> $GITHUB_OUTPUT
|
||||||
else
|
else
|
||||||
echo "VERSION=1.0.0-alpha-${{ github.run_id }}" >> $GITHUB_OUTPUT
|
VERSION="1.0.0-alpha-${{ github.run_id }}"
|
||||||
if [ ${{ github.event_name }} = "workflow_dispatch" ]; then
|
if [ ${{ github.event_name }} = "workflow_dispatch" ]; then
|
||||||
echo "Manual run detected, also updating 'latest' tag."
|
echo "Manual run detected, also updating 'latest' tag."
|
||||||
echo "LATEST=true" >> $GITHUB_OUTPUT
|
echo "LATEST=true" >> $GITHUB_OUTPUT
|
||||||
@@ -31,14 +30,14 @@ jobs:
|
|||||||
echo "LATEST=false" >> $GITHUB_OUTPUT
|
echo "LATEST=false" >> $GITHUB_OUTPUT
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
echo "VERSION=$VERSION" >> $GITHUB_OUTPUT
|
||||||
echo "TAG=$PREFIX:$VERSION" >> $GITHUB_OUTPUT
|
echo "TAG=$PREFIX:$VERSION" >> $GITHUB_OUTPUT
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: npm ci
|
run: npm ci
|
||||||
- name: Create .npmrc
|
- name: Create .npmrc
|
||||||
run: |
|
run: |
|
||||||
mkdir -p ~/.npm
|
|
||||||
echo "registry=https://gitea.controller.bittehackmichnicht.de/api/packages/apps/npm/" > ~/.npmrc
|
echo "registry=https://gitea.controller.bittehackmichnicht.de/api/packages/apps/npm/" > ~/.npmrc
|
||||||
echo "//gitea.controller.bittehackmichnicht.de/api/packages/apps/npm/:_authToken=${{ secrets.GITEA_TOKEN }}" >> ~/.npmrc
|
echo "//gitea.controller.bittehackmichnicht.de/api/packages/apps/npm/:_authToken=${{ secrets.PUSH_TOKEN }}" >> ~/.npmrc
|
||||||
- name: Build & publish npm package
|
- name: Build & publish npm package
|
||||||
env:
|
env:
|
||||||
VERSION: ${{ steps.generate_tag.outputs.VERSION }}
|
VERSION: ${{ steps.generate_tag.outputs.VERSION }}
|
||||||
@@ -52,7 +51,7 @@ jobs:
|
|||||||
LATEST: ${{ steps.generate_tag.outputs.LATEST }}
|
LATEST: ${{ steps.generate_tag.outputs.LATEST }}
|
||||||
run: |
|
run: |
|
||||||
docker build -t $TAG .
|
docker build -t $TAG .
|
||||||
echo ${{ secrets.GITEA_TOKEN }} | docker login gitea.controller.bittehackmichnicht.de -u ${{ github.actor }} --password-stdin
|
echo ${{ secrets.PUSH_TOKEN }} | docker login gitea.controller.bittehackmichnicht.de -u ${{ github.actor }} --password-stdin
|
||||||
docker push $TAG
|
docker push $TAG
|
||||||
if [ "$LATEST" = "true" ]; then
|
if [ "$LATEST" = "true" ]; then
|
||||||
docker tag $TAG gitea.controller.bittehackmichnicht.de/${{ github.repository }}/ptp-chat-frontend:latest
|
docker tag $TAG gitea.controller.bittehackmichnicht.de/${{ github.repository }}/ptp-chat-frontend:latest
|
||||||
|
|||||||
Reference in New Issue
Block a user