Pgwar optimize entity labels 2 #132
Workflow file for this run
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: Dockerize | |
on: | |
pull_request: | |
jobs: | |
# run tests before dockerizing | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v3 | |
with: | |
ref: ${{ github.head_ref }} | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@v2 | |
with: | |
registry: ghcr.io | |
username: geovbot | |
password: ${{ secrets.GEOVBOT_READ_WRITE_PACKAGES }} | |
# run database integration and unit tests | |
- name: run database tests | |
run: | | |
cd database | |
chmod -R 777 logs | |
export POSTGRES_PORT=5432 | |
bash test.sh -i -u -p | |
set-version: | |
runs-on: ubuntu-latest | |
needs: [test] | |
if: github.event_name == 'pull_request' | |
outputs: | |
version_tag: ${{steps.npm_version.outputs.tag}} | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v3 | |
with: | |
ref: ${{ github.head_ref }} | |
- name: Extract number of pull request | |
id: pull_request | |
run: | | |
echo ::set-output name=number::$(jq --raw-output .pull_request.number "$GITHUB_EVENT_PATH") | |
- name: Prints number of pull request | |
run: echo Pull request branch is '${{ steps.pull_request.outputs.number }}' | |
- name: Send Discord Notification | |
uses: sarisia/actions-status-discord@v1 | |
if: always() | |
with: | |
webhook: ${{ secrets.DISCORD_GITHUB_CHANNEL_WEBHOOK }} | |
title: 'Dockerize Toolbox Server and Client' | |
description: 'PR: ${{ steps.pull_request.outputs.number }}' | |
color: 0xffed2b | |
username: GitHub Actions | |
- name: Git Identity | |
run: | | |
git config --global user.name 'geovbot' | |
git config --global user.email '[email protected]' | |
git remote set-url origin https://$GITHUB_ACTOR:[email protected]/$GITHUB_REPOSITORY | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- uses: actions/setup-node@v2 | |
with: | |
node-version: '16.13.2' | |
registry-url: 'https://registry.npmjs.org' | |
- name: Tag this commit with pr | |
id: npm_version | |
run: | | |
npm version prerelease --preid pr-${{steps.pull_request.outputs.number}} --no-git-tag-version | |
echo ::set-output name=tag::$(cat ./package.json | jq -r '.version') | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Echo tag created by npm | |
run: echo your tag is '${{steps.npm_version.outputs.tag}}' | |
- name: Update Lock file | |
run: 'npm i --package-lock-only' | |
- uses: EndBug/add-and-commit@v5 | |
with: | |
message: 'chore(): update prerelease version' | |
tag: v${{steps.npm_version.outputs.tag}} | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
dockerize-webserver: | |
runs-on: ubuntu-latest | |
needs: [set-version] | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v3 | |
with: | |
ref: ${{ github.head_ref }} | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v2 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@v2 | |
with: | |
registry: ghcr.io | |
username: ${{ github.repository_owner }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Docker Build & Push | |
uses: docker/build-push-action@v3 | |
with: | |
# Location of Dockerfile, if not Dockerfile in root directory | |
file: webserver.dockerfile | |
# Directory to run `docker build` from, if not project root | |
context: . | |
push: true | |
tags: ghcr.io/geovistory/toolbox-server:${{needs.set-version.outputs.version_tag}} | |
- name: Send Discord Notification | |
uses: sarisia/actions-status-discord@v1 | |
if: always() | |
with: | |
webhook: ${{ secrets.DISCORD_GITHUB_CHANNEL_WEBHOOK }} | |
title: 'Dockerize Toolbox Server > Done' | |
description: 'Image Tag: ${{needs.set-version.outputs.version_tag}}' | |
color: 0x0000ff | |
username: GitHub Actions | |
dockerize-client: | |
runs-on: ubuntu-latest | |
needs: [set-version] | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v3 | |
with: | |
ref: ${{ github.head_ref }} | |
- uses: actions/setup-node@v2 | |
with: | |
node-version: '16.13.2' | |
registry-url: 'https://registry.npmjs.org' | |
- name: Setup version info | |
id: setup_version | |
run: 'npm --prefix client run setup:version' | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v2 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@v2 | |
with: | |
registry: ghcr.io | |
username: ${{ github.repository_owner }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Docker Build & Push | |
uses: docker/build-push-action@v3 | |
with: | |
# Location of Dockerfile, if not Dockerfile in root directory | |
file: client/Dockerfile | |
# Directory to run `docker build` from, if not project root | |
context: client | |
push: true | |
tags: ghcr.io/geovistory/toolbox-client:${{needs.set-version.outputs.version_tag}} | |
- name: Send Discord Notification | |
uses: sarisia/actions-status-discord@v1 | |
if: always() | |
with: | |
webhook: ${{ secrets.DISCORD_GITHUB_CHANNEL_WEBHOOK }} | |
title: 'Dockerize Toolbox Client > Done' | |
description: 'Image Tag: ${{needs.set-version.outputs.version_tag}}' | |
color: 0x0000ff | |
username: GitHub Actions |