Merge pull request #305 from KateOrient/feature/fix-tree-element-search #267
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 gui, create docker image and push to github registries. | |
on: | |
push: | |
branches: [ master ] | |
env: | |
# Use docker.io for Docker Hub if empty | |
REGISTRY: ghcr.io | |
# github.repository as <account>/<repo> | |
GUI_IMAGE_NAME: verapdf_gui | |
PROFILE: staging | |
jobs: | |
test-commit-message: | |
runs-on: ubuntu-latest | |
outputs: | |
is_version: ${{ steps.validation.outputs.is_version }} | |
steps: | |
- id: validation | |
run: echo "::set-output name=is_version::$([[ '${{ github.event.head_commit.message }}' =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]] && echo true || echo false)" | |
- name: Matches version pattern | |
run: echo "${{ steps.validation.outputs.is_version }}" | |
build: | |
needs: test-commit-message | |
if: ${{ needs.test-commit-message.outputs.is_version == 'true' }} | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
submodules: true | |
- name: Set up Node | |
uses: actions/setup-node@v1 | |
with: | |
node-version: '16.x' | |
- name: Update git submodules | |
run: git submodule update --init --recursive | |
- name: Build React app | |
run: yarn install --frozen-lockfile && yarn run build | |
- name: Build gui Docker image | |
run: docker build . -t $REGISTRY/verapdf/$GUI_IMAGE_NAME:latest --build-arg profile=$PROFILE | |
- name: Login into ${{ env.REGISTRY }} | |
uses: docker/login-action@28218f9b04b4f3f62068d7b6ce6ca5b26e35336c | |
with: | |
registry: ${{ env.REGISTRY }} | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Push gui Docker images to the ${{ env.REGISTRY }} | |
run: docker push $REGISTRY/verapdf/$GUI_IMAGE_NAME:latest |