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

[#27] Add build-image.yaml workflow to build docker images on push #26

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
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
57 changes: 57 additions & 0 deletions .github/workflows/build-image.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: ci

on:
push:
branches:
- 'issue#21-gh-action'

jobs:
Build-Docker-Image:
runs-on: ubuntu-latest
steps:
-
name: Checkout
uses: actions/checkout@v3
-
name: Set up QEMU
uses: docker/setup-qemu-action@v2
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
with:
platforms: linux/amd64,linux/arm64
-
name: Docker meta
id: meta
uses: docker/metadata-action@v4
with:
images: |
xserrat/facebook-demucs
tags: |
# set branch as tag name
type=ref,event=push,value={{branch}}
# set latest tag for default branch
type=raw,value=latest,enable={{is_default_branch}}
-
name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
# -
# name: Replace char '#' to '_' from GITHUB_REF_NAME env variable
# id: github_ref_name_replacement_step
# uses: frabert/[email protected]
# with:
# pattern: '#'
# string: ${{ github.ref_name }}
# replace-with: '_'
-
name: Build and push
uses: docker/build-push-action@v3
with:
context: .
push: true
platforms: linux/amd64,linux/arm64
tags: ${{ steps.meta.outputs.tags }}
# tags: xserrat/facebook-demucs:${{ steps.github_ref_name_replacement_step.outputs.replaced }}