-
-
Notifications
You must be signed in to change notification settings - Fork 0
31 lines (26 loc) · 831 Bytes
/
docker.yml
File metadata and controls
31 lines (26 loc) · 831 Bytes
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
name: "Deploy: Docker Image"
on:
workflow_run:
workflows: ["Test: Ruby"]
branches: [main]
types: [completed]
jobs:
build_and_push:
runs-on: ubuntu-latest
# Only run if the test workflow was successful
if: ${{ github.event.workflow_run.conclusion == 'success' }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ vars.DOCKER_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: ${{ vars.DOCKER_USERNAME }}/${{ github.event.repository.name }}:latest