fix: node edit & labels #46
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: product_builder | |
on: | |
push: | |
branches: [main] | |
env: | |
GITHUB_REGISTRY: ghcr.io | |
SERVICE_IMAGE_NAME: dyrector-io/darklens | |
AGENT_IMAGE_NAME: dyrector-io/darklens/agent | |
SERVICE_WORKING_DIRECTORY: web | |
AGENT_WORKING_DIRECTORY: . | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
service-build: | |
runs-on: ubuntu-22.04 | |
permissions: | |
packages: write | |
contents: read | |
container: | |
image: ghcr.io/dyrector-io/dyrectorio/builder-images/nodejs:1 | |
defaults: | |
run: | |
working-directory: ${{ env.SERVICE_WORKING_DIRECTORY }} | |
environment: Workflow - Protected | |
steps: | |
- name: Login to GHCR | |
uses: docker/login-action@v2 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GHCR_PAT }} | |
- name: Checkout | |
uses: actions/checkout@v3 | |
# fixes: fatal: unsafe repository | |
- name: Adding workspace | |
run: git config --global --add safe.directory "$GITHUB_WORKSPACE" | |
- name: Docker build | |
# latest tag for now | |
run: docker build -t ${GITHUB_REGISTRY}/${SERVICE_IMAGE_NAME}:latest . | |
- name: Push docker image to GHCR Registry | |
run: docker image push ${GITHUB_REGISTRY}/${SERVICE_IMAGE_NAME}:latest | |
agent-build: | |
runs-on: ubuntu-22.04 | |
permissions: | |
packages: write | |
contents: read | |
container: | |
image: ghcr.io/dyrector-io/dyrectorio/builder-images/golang:2 | |
defaults: | |
run: | |
working-directory: ${{ env.AGENT_WORKING_DIRECTORY }} | |
environment: Workflow - Protected | |
steps: | |
- name: Login to GHCR | |
uses: docker/login-action@v2 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GHCR_PAT }} | |
- name: Setup Golang caches | |
uses: actions/cache/restore@v3 | |
with: | |
path: /go | |
key: ${{ runner.os }}-golang-${{ hashFiles('go.sum') }} | |
- name: Checkout | |
uses: actions/checkout@v3 | |
# fixes: fatal: unsafe repository | |
- name: Adding workspace | |
run: git config --global --add safe.directory "$GITHUB_WORKSPACE" | |
- name: Load go mod | |
run: go mod tidy | |
- name: Compile agent | |
run: make compile-agent | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v2 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Setup binfmt | |
run: make binfmt | |
- name: Build agents | |
run: make build-agent | |
# TODO: Env for version | |
- name: Push agent image to GHCR Registry | |
run: docker image push ${GITHUB_REGISTRY}/${AGENT_IMAGE_NAME}:latest | |
- name: Save Golang caches | |
uses: actions/cache/save@v3 | |
with: | |
path: /go | |
key: ${{ runner.os }}-golang-${{ hashFiles('go.sum') }} |