-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-dev-action.yml
More file actions
29 lines (25 loc) · 932 Bytes
/
docker-dev-action.yml
File metadata and controls
29 lines (25 loc) · 932 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
name: Build Docker Image on Merge
on:
pull_request:
types: [closed]
branches:
- 'module/**'
jobs:
one:
if: github.event.pull_request.merged == true && github.event.pull_request.head.ref != 'main' && startsWith(github.event.pull_request.base.ref,'module/')
runs-on: ubuntu-latest
steps:
- name: Set branch name
id: set_branch_name
run: echo "BRANCH_NAME=${{ github.event.pull_request.base.ref }}" >> $GITHUB_ENV
- name: checkout code
uses: actions/checkout@v3
- name: Build the Docker image
run: docker build -t "telegrammy/backend:${BRANCH_NAME#module/}" .
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: telegrammy
password: ${{secrets.DOCKER_TOKEN}}
- name: Push to registry
run: docker push "telegrammy/backend:${BRANCH_NAME#module/}"