Add github image CI

This commit is contained in:
Charlie Laabs
2021-06-11 10:58:17 -05:00
parent fc26188097
commit 969ac6c1e3

View File

@@ -0,0 +1,44 @@
name: Build and push image
on:
push:
branches:
- master
jobs:
build_and_push_image:
name: Build Docker image and push to registries
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v1
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: charlocharlie
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Login to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
id: docker_build_push
uses: docker/build-push-action@v2
with:
push: true
tags: |
charlocharlie/markov-discord:latest
ghcr.io/${{ github.repository }}:latest
ghcr.io/${{ github.repository }}:${{ github.sha }}
- name: Image digest
run: echo ${{ steps.docker_build_push.outputs.digest }}