Skip to content

Commit

Permalink
yc
Browse files Browse the repository at this point in the history
  • Loading branch information
vitaliytv committed Oct 2, 2024
1 parent bbfc8b1 commit d60bb52
Show file tree
Hide file tree
Showing 3 changed files with 105 additions and 0 deletions.
62 changes: 62 additions & 0 deletions .github/workflows/docker-hub-ya.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: build-image-ya
on:
push:
branches:
- main

concurrency:
group: ${{ github.ref }}-${{ github.workflow }}
cancel-in-progress: true

jobs:
build-image:
name: build-image
runs-on: ubuntu-latest

# Add "id-token" with the intended permissions.
permissions:
contents: "read"
id-token: "write"

steps:
- uses: actions/checkout@v4

- id: "auth"
name: "Authenticate to Google Cloud"
uses: "google-github-actions/auth@v2"
with:
workload_identity_provider: "projects/753698311885/locations/global/workloadIdentityPools/github-pool/providers/github-provider"
service_account: "github-service-account@nitraai.iam.gserviceaccount.com"

- id: secrets
uses: google-github-actions/get-secretmanager-secrets@main
with:
secrets: |-
docker-hub:nitraai/docker-hub
- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: vitaliytv
password: ${{ steps.secrets.outputs.docker-hub }}

- name: Set up Docker Context for Buildx
id: buildx-context
run: |
docker context create builders
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v1
with:
version: latest
endpoint: builders

- name: build and push amd64
run: |
docker buildx build \
-f ya.Dockerfile . \
--platform linux/amd64 \
--tag nitra/actions-runner-ya:latest \
--tag "nitra/actions-runner-ya:${GITHUB_SHA::8}" \
--push
5 changes: 5 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"scripts": {
"ya-build": "docker build -t t1 -f ya.Dockerfile ."
}
}
38 changes: 38 additions & 0 deletions ya.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
FROM bitnami/kubectl AS kubectl


FROM ghcr.io/actions/actions-runner:latest

ENV TZ="Europe/Riga"

SHELL ["/bin/bash", "-o", "pipefail", "-c"]

COPY --from=kubectl /opt/bitnami/kubectl/bin/kubectl /usr/local/bin/

RUN sudo apt update && sudo apt install -y apt-transport-https ca-certificates curl gnupg

# Node 22
RUN curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | sudo gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg
RUN echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_22.x nodistro main" | sudo tee /etc/apt/sources.list.d/nodesource.list

# YC
RUN curl -sSL https://storage.yandexcloud.net/yandexcloud-yc/install.sh | bash

# # Install:
RUN sudo apt update && \
sudo apt-get install -y \
nodejs \
zip \
tzdata \
--no-install-recommends

RUN sudo npm install -g corepack

# RUN node --version && npm --version
# додаємо depcheck щоб швидше запускався
RUN npx depcheck --version && \
# npx esbuild --version && \
npx hasura-cli@2.36.2 version

RUN sudo rm -rf /var/lib/apt/lists/*

0 comments on commit d60bb52

Please sign in to comment.