-
-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add automatic dev builds in pipeline
- Loading branch information
1 parent
ae4ed64
commit d55e061
Showing
1 changed file
with
67 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
name: Docker Build and Push Dev | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
build-and-push-dev: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: write | ||
packages: write | ||
security-events: write | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/[email protected] | ||
|
||
- name: Docker Setup QEMU | ||
uses: docker/setup-qemu-action@v3 | ||
id: qemu | ||
with: | ||
platforms: amd64,arm64 | ||
|
||
- name: Log into ghcr.io registry | ||
uses: docker/[email protected] | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.repository_owner }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/[email protected] | ||
|
||
- name: Log in to Docker Hub | ||
uses: docker/[email protected] | ||
with: | ||
username: ${{ secrets.DOCKER_HUB_USERNAME }} | ||
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} | ||
|
||
- name: Build Docker Metadata | ||
id: docker-metadata | ||
uses: docker/metadata-action@v5 | ||
with: | ||
images: | | ||
ghcr.io/rivenmedia/riven | ||
docker.io/spoked/riven | ||
flavor: | | ||
latest=auto | ||
tags: | | ||
type=ref,event=branch | ||
type=sha,commit=${{ github.sha }} | ||
type=raw,value=dev,enable={{is_default_branch}} | ||
- name: Push Dev Image to repo | ||
uses: docker/build-push-action@v5 | ||
with: | ||
context: . | ||
file: ./Dockerfile | ||
push: true | ||
provenance: mode=max | ||
tags: ${{ steps.docker-metadata.outputs.tags }} | ||
labels: ${{ steps.docker-metadata.outputs.labels }} | ||
platforms: linux/amd64,linux/arm64 | ||
cache-from: type=gha,scope=${{ github.workflow }} | ||
cache-to: type=gha,mode=max,scope=${{ github.workflow }} |