doc: add contact us to README.md #58
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: builder | |
on: | |
push: | |
branches: [main] | |
env: | |
GITHUB_REGISTRY: ghcr.io | |
SERVICE_IMAGE_NAME: dyrector-io/darklens | |
AGENT_IMAGE_NAME: dyrector-io/darklens/agent | |
SETUP_WORKING_DIRECTORY: . | |
SERVICE_WORKING_DIRECTORY: web | |
AGENT_WORKING_DIRECTORY: . | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
setup: | |
runs-on: ubuntu-22.04 | |
permissions: | |
contents: read | |
outputs: | |
tag: ${{ steps.version.outputs.version }} | |
agent_tag: ${{ steps.version.outputs.short_version }} | |
defaults: | |
run: | |
working-directory: ${{ env.SETUP_WORKING_DIRECTORY }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Find version | |
id: version | |
run: | | |
export PACKAGE_VERSION=`cat web/backend/package.json | jq -r '.version'` | |
echo "version=$PACKAGE_VERSION" >> "$GITHUB_OUTPUT" | |
echo "short_version=${PACKAGE_VERSION%.*}" >> "$GITHUB_OUTPUT" | |
service-build: | |
runs-on: ubuntu-22.04 | |
needs: setup | |
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 | |
- name: Adding workspace | |
run: git config --global --add safe.directory "$GITHUB_WORKSPACE" | |
- name: Docker build | |
run: docker build -t ${GITHUB_REGISTRY}/${SERVICE_IMAGE_NAME}:latest . | |
- name: Push images to GHCR Registry | |
run: | | |
docker tag ${GITHUB_REGISTRY}/${SERVICE_IMAGE_NAME}:latest ${GITHUB_REGISTRY}/${SERVICE_IMAGE_NAME}:${{ needs.setup.outputs.tag }} | |
docker image push ${GITHUB_REGISTRY}/${SERVICE_IMAGE_NAME}:latest | |
docker image push ${GITHUB_REGISTRY}/${SERVICE_IMAGE_NAME}:${{ needs.setup.outputs.tag }} | |
agent-build: | |
runs-on: ubuntu-22.04 | |
needs: setup | |
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 | |
- 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 | |
env: | |
IMAGE_VERSION: latest | |
- name: Push images to GHCR Registry | |
run: | | |
docker tag ${GITHUB_REGISTRY}/${AGENT_IMAGE_NAME}:latest ${GITHUB_REGISTRY}/${AGENT_IMAGE_NAME}:${{ needs.setup.outputs.agent_tag }} | |
docker image push ${GITHUB_REGISTRY}/${AGENT_IMAGE_NAME}:latest | |
docker image push ${GITHUB_REGISTRY}/${AGENT_IMAGE_NAME}:${{ needs.setup.outputs.agent_tag }} | |
- name: Save Golang caches | |
uses: actions/cache/save@v3 | |
with: | |
path: /go | |
key: ${{ runner.os }}-golang-${{ hashFiles('go.sum') }} |