Commit 35d7c1ce by mingyuan

add cd

parent 8bbb2d83
name: Deploy
on:
push:
branches:
- deploy
jobs:
build:
name: Build image
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Docker build
run: |
docker build -t docker.pkg.github.com/$GITHUB_REPOSITORY:latest .
- name: Docker login
uses: docker/login-action@v1
with:
registry: docker.pkg.github.com
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Docker push latest
if: ${{ github.ref == 'refs/heads/main' }}
run: |
docker push docker.pkg.github.com/$GITHUB_REPOSITORY:latest
- name: Docker push production
if: ${{ github.ref == 'refs/heads/deploy' }}
run: |
docker tag docker.pkg.github.com/$GITHUB_REPOSITORY:latest docker.pkg.github.com/$GITHUB_REPOSITORY:production
docker push docker.pkg.github.com/$GITHUB_REPOSITORY:production
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment