mirror of
https://github.com/pacnpal/markov-discord.git
synced 2025-12-23 04:11:04 -05:00
44 lines
1.1 KiB
YAML
44 lines
1.1 KiB
YAML
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 }} |