diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..89a3859 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,27 @@ +on: push +permissions: + contents: read + pages: write + id-token: write +jobs: + yc_deploy_job: + runs-on: ubuntu-latest + name: A job to deploy to Yandex Cloud + steps: + - name: checkout + uses: actions/checkout@v4 + + - name: Login to Yandex Cloud Container Registry + id: login-cr + uses: yc-actions/yc-cr-login@v3 + with: + yc-sa-json-credentials: ${{ secrets.YC_SA_JSON_CREDENTIALS }} + + - name: Build, tag, and push image to Yandex Cloud Container Registry + env: + CR_REGISTRY: crpf2ioj2mkhi07jbnbr + CR_REPOSITORY: my-cr-repo + IMAGE_TAG: ${{ github.sha }} + run: | + docker build -t cr.yandex/$CR_REGISTRY/$CR_REPOSITORY:$IMAGE_TAG . + docker push cr.yandex/$CR_REGISTRY/$CR_REPOSITORY:$IMAGE_TAG diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..1b3322a --- /dev/null +++ b/Dockerfile @@ -0,0 +1,6 @@ +FROM node:latest +COPY deploy-app /app +WORKDIR /app +RUN npm i + +ENTRYPOINT [ "npm", "start" ] \ No newline at end of file