add meme gorilla_throw
(#190)
#287
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build docker image for meme-generator | |
on: | |
push: | |
branches: | |
- "main" | |
tags: | |
- "v*" | |
workflow_dispatch: | |
jobs: | |
push_to_registry: | |
name: Push Docker image to GitHub Packages | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
packages: write | |
steps: | |
- name: Check out the repo | |
uses: actions/checkout@v4 | |
- name: Setup Docker | |
uses: docker/setup-buildx-action@v3 | |
- name: Login to Docker Hub | |
uses: docker/login-action@v2 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Login to Github Container Registry | |
uses: docker/login-action@v2 | |
with: | |
registry: ghcr.io | |
username: ${{ github.repository_owner }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Generate Tags | |
uses: docker/metadata-action@v4 | |
id: metadata | |
with: | |
images: | | |
${{ github.repository }} | |
ghcr.io/${{ github.repository }} | |
tags: | | |
type=ref,event=branch | |
type=ref,event=pr | |
type=semver,pattern={{version}} | |
- name: Build and Publish | |
uses: docker/build-push-action@v5 | |
with: | |
context: . | |
platforms: linux/amd64,linux/arm64 | |
push: true | |
tags: ${{ steps.metadata.outputs.tags }} | |
labels: ${{ steps.metadata.outputs.labels }} | |
cache-from: type=gha | |
cache-to: type=gha,mode=max |