Skip to content

Commit

Permalink
seperate image building workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
mariusdkm committed Nov 12, 2021
1 parent db81dbd commit 53387dd
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 34 deletions.
42 changes: 42 additions & 0 deletions .github/workflows/dockerimage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: "Build docker image"

on:
push:
tags:
- 'v*'
workflow_dispatch:

jobs:
build-and-push-docker:
name: Build and push Docker image to GhCr
runs-on: ubuntu-latest
needs: build-launcher
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')
steps:
- name: Check out the repo
uses: actions/checkout@v2

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

- name: Log in to Docker Hub
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
with:
images: ghcr.io/keinenclue/sasm-docker
tags: type=ref,event=tag

- name: Build and push Docker image
uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
34 changes: 0 additions & 34 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,40 +69,6 @@ jobs:
name: launcher
path: launcher/out/*

build-and-push-docker:
name: Build and push Docker image to GhCr
runs-on: ubuntu-latest
needs: build-launcher
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')
steps:
- name: Check out the repo
uses: actions/checkout@v2

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

- name: Log in to Docker Hub
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
with:
images: ghcr.io/keinenclue/sasm-docker
tags: type=ref,event=tag

- name: Build and push Docker image
uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

tagged-release:
name: "Tagged Release"
runs-on: "ubuntu-latest"
Expand Down

0 comments on commit 53387dd

Please sign in to comment.