Release PASS-UI #9
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: Release PASS-UI | |
on: | |
workflow_dispatch: | |
inputs: | |
releaseversion: | |
required: true | |
description: Version to release (e.g. 0.4.0) | |
nextversion: | |
required: true | |
description: Next development version (e.g. 0.5.0-SNAPSHOT) | |
jobs: | |
release: | |
if: github.repository == 'eclipse-pass/pass-ui' | |
runs-on: ubuntu-latest | |
env: | |
ENV_FILE: https://raw.githubusercontent.com/eclipse-pass/pass-docker/main/.env | |
DOCKER_IMAGE_NAME: ghcr.io/eclipse-pass/pass-ui | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Config git user | |
run: | | |
git config user.name ${{ github.actor }} | |
git config user.email "${{ github.actor }}@users.noreply.github.com" | |
- name: Setup Node & Yarn | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 18 | |
cache: 'yarn' | |
- name: Update project version | |
run: | | |
yarn install --frozen-lockfile | |
yarn version --new-version ${{ inputs.releaseversion }} | |
- name: Tag release | |
run: git tag ${{ inputs.releaseversion }} | |
- name: Build pass-ui | |
uses: ./.github/actions/build-pass-ui | |
with: | |
is-prod: true | |
- name: Login to GHCR | |
uses: docker/login-action@v2 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Retag and push | |
run: | | |
docker tag $DOCKER_IMAGE_NAME:latest $DOCKER_IMAGE_NAME:${{ inputs.releaseversion }} | |
docker push $DOCKER_IMAGE_NAME:latest | |
docker push $DOCKER_IMAGE_NAME:${{ inputs.releaseversion }} | |
- name: Update project version | |
run: yarn version --new-version ${{ inputs.nextversion }} | |
- name: Build next dev version | |
uses: ./.github/actions/build-pass-ui | |
with: | |
is-prod: false | |
# Commits made to branch specified in workflow_dispatch, push that branch if possible | |
- name: Push release commits to GH | |
if: github.ref_type == 'branch' && github.ref_protected == false | |
run: git push origin ${{ github.ref_name }} | |
# Push the release tag we made above | |
- name: Push release tag to GH | |
run: git push origin ${{ inputs.releaseversion }} | |
- name: Push next dev version image | |
run: | | |
docker tag $DOCKER_IMAGE_NAME:${{ inputs.releaseversion }} $DOCKER_IMAGE_NAME:${{ inputs.nextversion }} | |
docker push $DOCKER_IMAGE_NAME:${{ inputs.nextversion }} |