-
Notifications
You must be signed in to change notification settings - Fork 19
78 lines (70 loc) · 2.66 KB
/
datagrillen-docker-image.yml
File metadata and controls
78 lines (70 loc) · 2.66 KB
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
name: Data Grillen Docker Image Build
on:
push:
branches: [ main ]
paths:
- 2022/DataGrillen/datagrillen1/**
- 2022/DataGrillen/datagrillen2/**
pull_request:
branches: [ main ]
paths:
- 2022/DataGrillen/datagrillen1/**
- 2022/DataGrillen/datagrillen2/**
workflow_dispatch:
jobs:
docker:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: '0'
-
name: Bump version and push tag
id: bump
uses: anothrNick/github-tag-action@1.36.0
env:
DEFAULT_BUMP: minor
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
WITH_V: true
-
name: Set up QEMU
uses: docker/setup-qemu-action@v1
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
-
name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
-
name: Build and push First Container
uses: docker/build-push-action@v2
with:
push: true
context: 2022/DataGrillen/datagrillen1/
tags: ${{ secrets.DOCKERHUB_USERNAME }}/datagrillen1:${{ steps.bump.outputs.new_tag }},${{ secrets.DOCKERHUB_USERNAME }}/datagrillen1:latest
-
name: Build and push Sql Instance 2
uses: docker/build-push-action@v2
with:
push: true
context: 2022/DataGrillen/datagrillen2/
tags: ${{ secrets.DOCKERHUB_USERNAME }}/datagrillen2:${{ steps.bump.outputs.new_tag }},${{ secrets.DOCKERHUB_USERNAME }}/datagrillen2:latest
-
name: Replace new tag in Demo and Docker Compose
shell: pwsh
run: |
$replace = "${{ steps.bump.outputs.new_tag }}"
$newDockerCompose = (Get-Content 2022\DataGrillen\.devcontainer\docker-compose.yml) -replace 'datagrillen1:v.*', "datagrillen1:$replace" -replace 'datagrillen2:v.*', "datagrillen2:$replace"
$newDockerCompose | Set-Content 2022\DataGrillen\.devcontainer\docker-compose.yml
$newDemo = (Get-Content 2022/DataGrillen/demo.ps1) -replace 'datagrillen1:v.*', "datagrillen1:$replace" -replace 'datagrillen2:v.*', "datagrillen2:$replace"
$newDemo | Set-Content 2022/DataGrillen/demo.ps1
-
name: Add & Commit
uses: EndBug/add-and-commit@v8.0.2
with:
author_name: Beardy McBeardFace
author_email: mrrobsewell@outlook.com
message: 'The Beard says we have another Data Grillen container ${{ steps.bump.outputs.new_tag }} - This is an automated message'