mirror of
https://github.com/lukevella/rallly.git
synced 2025-04-28 17:56:37 +02:00
CI/CD: Automatically publish Docker image (#349)
This commit is contained in:
parent
09977e7b61
commit
e34e1e9eba
2 changed files with 29 additions and 2 deletions
28
.github/workflows/docker-image.yml
vendored
Normal file
28
.github/workflows/docker-image.yml
vendored
Normal file
|
@ -0,0 +1,28 @@
|
|||
name: Build and publish Docker image
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
publish:
|
||||
name: Build and publish Docker image
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Log in to Docker Hub
|
||||
uses: docker/login-action@v2
|
||||
with:
|
||||
username: ${{ secrets.DOCKER_USERNAME }}
|
||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||
|
||||
- name: Check out repository code
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Build and publish image
|
||||
uses: docker/build-push-action@v3
|
||||
with:
|
||||
push: true
|
||||
tags: |
|
||||
${{ secrets.DOCKER_USERNAME }}/rallly:latest
|
||||
${{ secrets.DOCKER_USERNAME }}/rallly:${{ github.sha }}
|
|
@ -15,8 +15,7 @@ services:
|
|||
retries: 5
|
||||
|
||||
rallly:
|
||||
build:
|
||||
context: .
|
||||
image: lukevella/rallly:latest
|
||||
restart: always
|
||||
depends_on:
|
||||
rallly_db:
|
||||
|
|
Loading…
Add table
Reference in a new issue