Skip to content
This repository has been archived by the owner on Apr 25, 2024. It is now read-only.

[DIR-1032] New NamespaceSelector component #1097

[DIR-1032] New NamespaceSelector component

[DIR-1032] New NamespaceSelector component #1097

Workflow file for this run

name: Create and push PR Docker image
on: pull_request
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
jobs:
build-and-push-image:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Log in to the Container registry
uses: docker/login-action@v2
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v4
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=ref,event=branch
type=ref,event=pr
type=sha,format=long
- name: Build and push Docker image
uses: docker/build-push-action@v4
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
deploy-review-app:
runs-on: ubuntu-latest
needs: build-and-push-image
permissions:
contents: read
packages: read
env:
NOMAD_TOKEN: ${{ secrets.NOMAD_TOKEN }}
NOMAD_ADDR: https://nomad.direktiv.dev:4646
NOMAD_VAR_IMAGE: ghcr.io/${{ github.repository }}:sha-${{ github.sha }}
NOMAD_VAR_UI_BACKEND: ${{ secrets.API_IP }}
steps:
- uses: actions/checkout@v2
- uses: lucasmelin/setup-nomad@v1
with:
version: "1.5.5"
- name: Deploy to nomad
timeout-minutes: 4
run: |
sed -i "s/DEPLOYMENT_NAME/${GITHUB_REF////-}/g" deploy.nomad
nomad validate deploy.nomad
nomad run deploy.nomad
- name: Adding markdown
run: |
echo '### Review App 🚀' >> $GITHUB_STEP_SUMMARY
echo "[${GITHUB_REF////-}](https://direktiv-ui-${GITHUB_REF////-}.direktiv.dev)" >> $GITHUB_STEP_SUMMARY