Skip to content

Commit

Permalink
feat: publish Docker image via GitHub Actions
Browse files Browse the repository at this point in the history
  • Loading branch information
emilylange committed Jan 9, 2022
1 parent 559cb1c commit 9ddbf73
Showing 1 changed file with 51 additions and 0 deletions.
51 changes: 51 additions & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Docker
on:
push:
branches:
- main
tags:
- "v*"

jobs:
docker:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Generate Docker meta
id: docker_meta
uses: docker/metadata-action@v3
with:
images: indeednotjames/matrix-sip-bridge,ghcr.io/indeednotjames/matrix-sip-bridge
tags: |
type=sha
type=edge
type=semver,enable=${{ startsWith(github.ref, 'refs/tags/v') }},pattern={{version}}
type=semver,enable=${{ startsWith(github.ref, 'refs/tags/v') }},pattern={{major}}.{{minor}}
- name: Set up QEMU
uses: docker/setup-qemu-action@v1

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1

- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
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.CR_PAT }}

- name: Build and push
uses: docker/build-push-action@v2
with:
push: true
tags: ${{ steps.docker_meta.outputs.tags }}
platforms: linux/amd64,linux/arm64,linux/arm/v7

0 comments on commit 9ddbf73

Please sign in to comment.