Skip to content

Commit c91ee94

Browse files
authored
Add Standalone Docker Compose (#26)
* Adds Deploying with Compose (non-swarm) * Adds Error Status and Logs in Job Summary * Fixes Detect stack deploy failures
1 parent a2bd778 commit c91ee94

File tree

7 files changed

+371
-95
lines changed

7 files changed

+371
-95
lines changed

.github/workflows/release.yaml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,17 @@ jobs:
1414

1515
steps:
1616
- name: "Update Tags"
17+
id: tags
1718
uses: cssnr/update-version-tags-action@v1
19+
20+
- name: "Debug Tags"
21+
run: |
22+
echo "github.ref_name: ${{ github.ref_name }}"
23+
echo "steps.tags.outputs.tags: ${{ steps.tags.outputs.tags }}"
24+
25+
- name: "Update Release Notes Action"
26+
uses: smashedr/update-release-notes-action@master
27+
continue-on-error: true
28+
with:
29+
tags: "${{ steps.tags.outputs.tags }}"
30+
location: tail

.github/workflows/test.yaml

Lines changed: 49 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,16 @@ on:
1818
env:
1919
PRIVATE_IMAGE: ${{ vars.PRIVATE_IMAGE || 'smashedr/alpine-private:latest' }}
2020

21+
concurrency:
22+
group: ${{ github.workflow }}
23+
cancel-in-progress: true
24+
2125
jobs:
2226
test:
2327
name: "Test"
2428
if: ${{ !contains(github.event.head_commit.message, '#notest') }}
2529
runs-on: ubuntu-latest
2630
timeout-minutes: 5
27-
concurrency:
28-
group: ${{ github.workflow }}
29-
cancel-in-progress: true
3031

3132
steps:
3233
- name: "Checkout"
@@ -82,6 +83,51 @@ jobs:
8283
registry_pass: ${{ secrets.DOCKER_HUB_PASS }}
8384
summary: false
8485

86+
- name: "3: Write YAML"
87+
if: ${{ !cancelled() && !github.event.act }}
88+
uses: teunmooij/yaml@v1
89+
with:
90+
to-file: "docker-compose.yaml"
91+
data: |
92+
{"version":"3.8","services":{"alpine":{"image":"alpine:latest","command":"tail -f /dev/null"}}}
93+
94+
- name: "3: Test Compose"
95+
if: ${{ !cancelled() && !github.event.act }}
96+
uses: ./
97+
with:
98+
name: test_stack-deploy-compose
99+
file: docker-compose.yaml
100+
host: ${{ secrets.DOCKER_HOST }}
101+
port: ${{ secrets.DOCKER_PORT }}
102+
user: ${{ secrets.DOCKER_USER }}
103+
pass: ${{ secrets.DOCKER_PASS }}
104+
#ssh_key: ${{ secrets.DOCKER_SSH_KEY }}
105+
mode: compose
106+
summary: false
107+
108+
- name: "4: Write YAML"
109+
if: ${{ !cancelled() }}
110+
uses: teunmooij/yaml@v1
111+
with:
112+
to-file: "docker-compose.yaml"
113+
data: |
114+
{"version":"3.8","services":{"alpine":{"image":"${{ env.PRIVATE_IMAGE }}","command":"tail -f /dev/null"}}}
115+
116+
- name: "4: Test Compose SSH and Auth"
117+
if: ${{ !cancelled() }}
118+
uses: ./
119+
with:
120+
name: test_stack-deploy-compose
121+
file: docker-compose.yaml
122+
host: ${{ secrets.DOCKER_HOST }}
123+
port: ${{ secrets.DOCKER_PORT }}
124+
user: ${{ secrets.DOCKER_USER }}
125+
#pass: ${{ secrets.DOCKER_PASS }}
126+
ssh_key: ${{ secrets.DOCKER_SSH_KEY }}
127+
mode: compose
128+
registry_user: ${{ vars.DOCKER_HUB_USER }}
129+
registry_pass: ${{ secrets.DOCKER_HUB_PASS }}
130+
85131
- name: "Schedule Failure Notification"
86132
if: ${{ failure() && github.event_name == 'schedule' }}
87133
uses: sarisia/actions-status-discord@v1

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
> [!WARNING]
44
> This guide is a work in progress and may not be complete.
55
6-
This is a basic contributing guide and is a work in progress.
6+
Note: This guide is not updated for Compose but those tests work the same way.
77

88
## Workflow
99

0 commit comments

Comments
 (0)