Skip to content

Build and Push Docker Images on Tag #1

Build and Push Docker Images on Tag

Build and Push Docker Images on Tag #1

name: Build and Push Docker Images on Tag
on:
push:
tags:
- 'web@*'
- 'server@*'
workflow_dispatch:
jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Log in to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build and push web image
uses: docker/build-push-action@v2
with:
context: .
file: ./apps/web/Dockerfile
push: true
tags: hqwuzhaoyi/gpt-subtitle-web:latest
platforms: linux/amd64,linux/arm64
- name: Build and push API image
uses: docker/build-push-action@v2
with:
context: .
file: ./apps/server/Dockerfile
push: true
tags: hqwuzhaoyi/gpt-subtitle-api:latest
platforms: linux/amd64,linux/arm64