33 lines
874 B
YAML
33 lines
874 B
YAML
name: Deploy
|
|
|
|
on:
|
|
workflow_run:
|
|
workflows: ["Check"]
|
|
types:
|
|
- completed
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
docker:
|
|
if: ${{ github.event_name == 'workflow_dispatch' || (github.event.workflow_run.conclusion == 'success' && startsWith(github.ref, 'refs/tags/v')) }}
|
|
runs-on: ubuntu-latest
|
|
environment: battleship
|
|
steps:
|
|
-
|
|
name: Login to Docker Hub
|
|
uses: docker/login-action@v3
|
|
with:
|
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
|
-
|
|
name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v3
|
|
-
|
|
name: Build and push
|
|
uses: docker/build-push-action@v6
|
|
with:
|
|
push: true
|
|
tags: ${{ secrets.DOCKER_IMAGE_PATH }}:latest
|
|
cache-from: type=gha
|
|
cache-to: type=gha,mode=max
|