-
-
Notifications
You must be signed in to change notification settings - Fork 3
33 lines (33 loc) · 1.24 KB
/
docker_github.yml
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
30
31
32
33
name: Docker Github
on:
create:
tags:
- 'v*'
jobs:
build:
name: Build image
runs-on: ubuntu-latest
steps:
- name: Docker login
uses: docker/login-action@v4
with:
registry: docker.pkg.github.com
username: ${{ github.actor }}
password: ${{ secrets.AK }}
- name: Checkout code
uses: actions/checkout@v4
with:
submodules: true
token: ${{ github.token }}
- name: Docker build
run: |
docker build -t docker.pkg.github.com/$GITHUB_REPOSITORY/${{ github.event.repository.name }}:latest -f docker/engine/Dockerfile .
- name: Docker push latest
if: ${{ github.ref == 'refs/heads/main' }}
run: |
docker push docker.pkg.github.com/$GITHUB_REPOSITORY/${{ github.event.repository.name }}:latest
- name: Docker push production
if: ${{ github.ref == 'refs/heads/deploy' }}
run: |
docker tag docker.pkg.github.com/$GITHUB_REPOSITORY/${{ github.event.repository.name }}:latest docker.pkg.github.com/$GITHUB_REPOSITORY/${{ github.event.repository.name }}:production
docker push docker.pkg.github.com/$GITHUB_REPOSITORY/${{ github.event.repository.name }}:production