-
Notifications
You must be signed in to change notification settings - Fork 0
45 lines (43 loc) · 1.39 KB
/
publish-docker-image.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
name: publish-docker-image
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
on:
workflow_dispatch:
inputs:
image:
type: choice
description: Docker image to be published
options:
- Game consumer
- Game service
- User service
jobs:
publish:
env:
DOCKER_IMAGE: >
${{ fromJson('{
"Game consumer": "robertopintosl/one-game-backend-consumer-game",
"Game service": "robertopintosl/one-game-backend-service-game",
"User service": "robertopintosl/one-game-backend-service-user"
}')[github.event.inputs.environment] }}
NPM_BUILD_SCRIPT: >
${{ fromJson('{
"Game consumer": "docker:build:game:consumer:npm",
"Game service": "docker:build:game:service:npm",
"User service": "docker:build:user:service:npm"
}')[github.event.inputs.environment] }}
name: Build and publish image
environment: CI
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: ./.github/actions/publish-docker-image
with:
docker-image: ${{ env.DOCKER_IMAGE }}
docker-password: ${{ secrets.DOCKER_TOKEN }}
docker-username: ${{ vars.DOCKER_USERNAME }}
npm-build-script: ${{ env.NPM_BUILD_SCRIPT }}