Skip to content

share methods

share methods #47

Workflow file for this run

name: Docker Github
on:
push:
branches:
- main
jobs:
build:
name: Build image
runs-on: ubuntu-latest
steps:
- name: Docker login
uses: docker/login-action@v1
with:
registry: docker.pkg.github.com
username: ${{ github.actor }}
password: ${{ secrets.AK }}
- name: Checkout code
uses: actions/checkout@v2
with:
submodules: true
- 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