-
-
Notifications
You must be signed in to change notification settings - Fork 35
89 lines (79 loc) · 2.53 KB
/
test.yaml
File metadata and controls
89 lines (79 loc) · 2.53 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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
name: "Test"
on:
workflow_dispatch:
schedule:
- cron: "18 18 * * 1,3,5"
push:
branches: ["**"]
paths:
- "dist/**"
- "src/**"
- ".github/workflows/test.yaml"
- "Dockerfile"
- "package*.json"
- "requirements*.txt"
- "action.yaml"
env:
PRIVATE_IMAGE: ${{ vars.PRIVATE_IMAGE || 'smashedr/alpine-private:latest' }}
jobs:
test:
name: "Test"
if: ${{ !contains(github.event.head_commit.message, '#notest') }}
runs-on: ubuntu-latest
timeout-minutes: 5
concurrency:
group: ${{ github.workflow }}
cancel-in-progress: true
steps:
- name: "Checkout"
uses: actions/checkout@v4
#- name: "Debug event.json"
# run: |
# cat "${GITHUB_EVENT_PATH}"
- name: "1: Write YAML"
if: ${{ !cancelled() }}
uses: teunmooij/yaml@v1
with:
to-file: "docker-compose.yaml"
data: |
{"version":"3.8","services":{"alpine":{"image":"alpine:latest","command":"tail -f /dev/null"}}}
- name: "1: Test Password"
if: ${{ !cancelled() }}
uses: ./
with:
name: test_stack-deploy
file: docker-compose.yaml
host: ${{ secrets.DOCKER_HOST }}
port: ${{ secrets.DOCKER_PORT }}
user: ${{ secrets.DOCKER_USER }}
pass: ${{ secrets.DOCKER_PASS }}
#ssh_key: ${{ secrets.DOCKER_SSH_KEY }}
detach: false
resolve_image: "changed"
- name: "2: Write YAML"
if: ${{ !cancelled() && !github.event.act }}
uses: teunmooij/yaml@v1
with:
to-file: "docker-compose.yaml"
data: |
{"version":"3.8","services":{"alpine":{"image":"${{ env.PRIVATE_IMAGE }}","command":"tail -f /dev/null"}}}
- name: "2: Test SSH and Auth"
if: ${{ !cancelled() && !github.event.act }}
uses: ./
with:
name: test_stack-deploy
file: docker-compose.yaml
host: ${{ secrets.DOCKER_HOST }}
port: ${{ secrets.DOCKER_PORT }}
user: ${{ secrets.DOCKER_USER }}
#pass: ${{ secrets.DOCKER_PASS }}
ssh_key: ${{ secrets.DOCKER_SSH_KEY }}
prune: true
registry_user: ${{ vars.DOCKER_HUB_USER }}
registry_pass: ${{ secrets.DOCKER_HUB_PASS }}
summary: false
- name: "Schedule Failure Notification"
if: ${{ failure() && github.event_name == 'schedule' }}
uses: sarisia/actions-status-discord@v1
with:
webhook: ${{ secrets.DISCORD_WEBHOOK }}