Skip to content

Commit

Permalink
👷 Add auto-release to DockerHub
Browse files Browse the repository at this point in the history
  • Loading branch information
LeoColman committed Jan 2, 2024
1 parent d1aedaf commit c2f6558
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/release.main.kts
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,20 @@ import io.github.typesafegithub.workflows.actions.azure.DockerLoginV1
import io.github.typesafegithub.workflows.actions.docker.BuildPushActionV5
import io.github.typesafegithub.workflows.actions.gradle.GradleBuildActionV2
import io.github.typesafegithub.workflows.domain.RunnerType.UbuntuLatest
import io.github.typesafegithub.workflows.domain.triggers.Release
import io.github.typesafegithub.workflows.domain.triggers.Push
import io.github.typesafegithub.workflows.dsl.expressions.Contexts
import io.github.typesafegithub.workflows.dsl.expressions.expr
import io.github.typesafegithub.workflows.dsl.workflow
import io.github.typesafegithub.workflows.yaml.writeToFile

val version = expr { Contexts.github.ref }
val version = expr { Contexts.github.ref_name }
val DOCKER_HUB_USERNAME by Contexts.secrets
val DOCKER_HUB_TOKEN by Contexts.secrets
val dockerNamespace = "jopiterapp/jopiter-backend"

workflow(
name = "Release",
on = listOf(Release()),
on = listOf(Push(tags = listOf("*"))),
sourceFile = __FILE__.toPath()
) {
job(id = "Release", runsOn = UbuntuLatest) {
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@

name: 'Release'
on:
release: {}
push:
tags:
- '*'
jobs:
check_yaml_consistency:
name: 'Check YAML consistency'
Expand Down Expand Up @@ -52,4 +54,4 @@ jobs:
push: 'true'
tags: |-
jopiterapp/jopiter-backend:latest
jopiterapp/jopiter-backend:${{ github.ref }}
jopiterapp/jopiter-backend:${{ github.ref_name }}

0 comments on commit c2f6558

Please sign in to comment.