Skip to content

fix: Release latest to dockerhub #1

fix: Release latest to dockerhub

fix: Release latest to dockerhub #1

Workflow file for this run

name: Release
on:
push:
jobs:
main:
if: ${{ github.event.workflow_run.conclusion == 'success' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
token: '${{ secrets.TOLGEE_MACHINE_PAT }}'
- uses: actions/setup-java@v3
with:
java-version: 17
distribution: adopt
- name: Setup node
uses: actions/setup-node@v3
with:
node-version: "18.x"
- name: Set git globals
run: |
git config --local user.email "machine@tolgee.io"
git config --local user.name "Tolgee Machine"
- name: Install node modules
run: npm ci
- name: Run get new version
run: npm run release-dry
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Set version property
id: version
run: echo "VERSION=$(test -e .VERSION && echo v$(cat .VERSION))" >> $GITHUB_OUTPUT
- name: BootJar with version
if: ${{ steps.version.outputs.VERSION != '' }}
run: ./gradlew bootJar
env:
VERSION: ${{ steps.version.outputs.VERSION }}
TOLGEE_API_KEY: ${{secrets.TOLGEE_API_KEY}}
TOLGEE_API_URL: ${{secrets.TOLGEE_API_URL}}
- name: Login to docker
if: ${{ steps.version.outputs.VERSION != '' }}
run: docker login -u ${{ secrets.DOCKERHUB_USERNAME }} -p "${{ secrets.DOCKERHUB_PASSWORD }}"
- name: Prepare for docker build
if: ${{ steps.version.outputs.VERSION != '' }}
run: ./gradlew dockerPrepare
env:
VERSION: ${{ steps.version.outputs.VERSION }}
TOLGEE_API_KEY: ${{secrets.TOLGEE_API_KEY}}
TOLGEE_API_URL: ${{secrets.TOLGEE_API_URL}}
- name: Create docker image
if: ${{ steps.version.outputs.VERSION != '' }}
run: |
docker buildx create --use
docker buildx build . -t tolgee/tolgee:latest --platform linux/arm64,linux/amd64 --push
working-directory: build/docker
- name: Pack with webapp
if: ${{ steps.version.outputs.VERSION != '' }}
run: ./gradlew packResources
env:
VERSION: ${{ steps.version.outputs.VERSION }}
TOLGEE_API_KEY: ${{secrets.TOLGEE_API_KEY}}
TOLGEE_API_URL: ${{secrets.TOLGEE_API_URL}}