Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Publish container image on release #285

Merged
merged 2 commits into from
Nov 20, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions .github/workflows/build-image.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
---
name: publish container image

on:
push:
MindTooth marked this conversation as resolved.
Show resolved Hide resolved
branches:
- master
MindTooth marked this conversation as resolved.
Show resolved Hide resolved
release:
types:
- created
workflow_dispatch:

jobs:
docker:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set tag for image
run: |
echo IMAGE_TAG=$([ ${{ github.ref_type }} == 'tag' ] && echo ${{ github.ref_name }} || echo 'latest') >> $GITHUB_ENV
MaxymVlasov marked this conversation as resolved.
Show resolved Hide resolved
- name: Build and Push
uses: docker/build-push-action@v2
with:
context: .
platforms: linux/amd64
MindTooth marked this conversation as resolved.
Show resolved Hide resolved
push: true
tags: |
ghcr.io/${{ github.repository }}:${{ env.IMAGE_TAG }}