Skip to content

Openverse is a search engine for openly-licensed media. This monorepo includes all application code.

Publish branch and main images to ghcr (#1314)

sarayourfriend5e72fd46dbe1
diff --git a/.github/workflows/ghcr.yml b/.github/workflows/ghcr.yml
new file mode 100644
index 000000000..daa317f4e
--- /dev/null
+++ b/.github/workflows/ghcr.yml
@@ -0,0 +1,43 @@
+name: GitHub Container Registry
+
+on:
+ push:
+ branches:
+ - main
+ pull_request:
+ branches:
+ - main
+
+jobs:
+ push-to-ghcr:
+ name: Build and push image for commit
+ runs-on: ubuntu-latest
+
+ steps:
+ - name: checkout
+ uses: actions/checkout@v2
+
+ - uses: docker/setup-buildx-action@v1
+ with:
+ install: true
+
+ - uses: docker/login-action@v1
+ with:
+ registry: https://ghcr.io
+ username: ${{ github.actor }}
+ password: ${{ secrets.GITHUB_TOKEN }}
+
+ - uses: docker/metadata-action@v3
+ id: metadata
+ with:
+ images: ghcr.io/wordpress/openverse-frontend
+ tags: |
+ type=sha
+ type=ref,event=tag
+
+ - uses: docker/build-push-action@v2
+ with:
+ context: .
+ tags: ${{ steps.metadata.outputs.tags }}
+ labels: ${{ steps.metadata.outputs.labels }}
+ push: true