Skip to content
This repository was archived by the owner on Mar 15, 2023. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 63 additions & 0 deletions .github/workflows/pr_deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: Deploy pull request

on: pull_request

env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}

jobs:
build-and-push-image:
name: Build Development
runs-on: ubuntu-latest
permissions:
contents: read
packages: write

steps:
- name: Checkout repository
uses: actions/checkout@v2

- 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 }}

- name: Build and push Docker image
uses: docker/build-push-action@v4
with:
context: .
push: true
build-args: |
BUILD_MODE=development
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

deploy-dev:
name: Deploy Development
runs-on: ubuntu-latest
needs: build-and-push-image
environment:
name: development
url: https://${{ github.event.repository.name }}__pr-${{ github.event.pull_request.number }}.dev.profcomff.com/
steps:
- name: Deploy
run: |
curl -X 'POST' \
'https://ci.dev.profcomff.com/pr_run' \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
-H 'Authorization: ${{ secrets.CI_DYAKOVSPACE_MSK_TOKEN }}' \
-d '{
"repo_url": "${{ github.repository }}",
"git_ref": "${{ github.ref }}"
}'

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Review deployment
name: Lint pull request

on: pull_request

Expand Down
31 changes: 31 additions & 0 deletions .github/workflows/pr_stop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Deploy pull request (stop)

on:
pull_request:
types: [closed]

env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}

jobs:
stop-deployment-dev:
name: Deploy Development (stop)
runs-on: ubuntu-latest
permissions:
contents: read
packages: write

steps:
- name: Stop deployment
run: |
curl -X 'POST' \
'https://ci.dev.profcomff.com/pr_stop' \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
-H 'Authorization: ${{ secrets.CI_DYAKOVSPACE_MSK_TOKEN }}' \
-d '{
"repo_url": "${{ github.repository }}",
"git_ref": "${{ github.ref }}"
}'