CI/CD: Automatically publish Docker image (#349)

This commit is contained in:
Sam A 2022-11-07 10:48:33 +01:00 committed by GitHub
parent 09977e7b61
commit e34e1e9eba
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 29 additions and 2 deletions

28
.github/workflows/docker-image.yml vendored Normal file
View 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 }}

View file

@ -15,8 +15,7 @@ services:
retries: 5
rallly:
build:
context: .
image: lukevella/rallly:latest
restart: always
depends_on:
rallly_db: